Your question isn't too clear, but I'm going to take it that you want additional email headers, such as X-Mailer: or X-Referring-IP: headers.

Thunders has already given good pointers to the modules that you should look into if you decide to write this sort of thing yourself.

There are many scripts out there that can do this, although I would suggest you try and understand what the script is doing - some of the scripts out there are far from perfect.
The already mentioned nms should be considered one of the best.
If you're looking for a full-on webmail system, then look at acmemail or Neomail.

Here's a quick example of how to send an email with extra email headers I've russled up - it's pretty much what's in the documentation with some extra headers added. Note:

#!/usr/bin/perl -w use strict; use Net::SMTP; my $smtp = Net::SMTP->new('mailhost.foo.com'); $smtp->data(); $smtp->datasend("To: user@bar.com\n"); $smtp->datasend("X-Mailer: Random dodgy email script\n"); $smtp->datasend("X-My-Favourite-Whisky: Glenfarclas\n"); # The following newline is the delimiter between the header # and the body. # For more info, on headers and how to form a email # you should read the RFC for SMTP. $smtp->datasend("\n"); # Following line is the message body. $smtp->datasend("If this works, you've got Perl to thank.\n"); $smtp->dataend(); $smtp->quit;

Update: Added a comment to the example code to clearly show the header and body sections of the transaction.


In reply to Re: extended email headers by BazB
in thread Xtended Headers by Gremlin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.