Gremlin has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Xtended Headers
by thunders (Priest) on Jan 24, 2002 at 09:12 UTC
    I don't know much about Xtended headers.
    But you probably want to look into one or more of the following modules
    Mail::Sendmail
    Mail::Sender
    Net::POP3
    Net::SMTP

    Update:I reread your post and noticed that you asked for a script. our very own davorg maintains a list of easy to use scripts at nms Perhaps something like Formmail is more up your alley.

Re: extended email headers
by BazB (Priest) on Jan 24, 2002 at 17:55 UTC

    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:

    • I haven't tested it.
    • There is no error checking
    • I also think it looks horrid :-)
    #!/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.