John Deretich wrote:
> Thanks Mark,
>
> but one question?
> I tried $smtp->datasend("X-Sent: xxx\n");
> But it didn't put the additional line into
> the header. Any idea why?
This should do it - modify to suit :
use strict;
use Net::SMTP;
my $mailhost = 'your-smtp-server-here';
my $me = 'your-email-addr-here';
my $to = $me; # for testing
# connect to an SMTP server
my $smtp = Net::SMTP->new($mailhost) or die "new SMTP: $! ($^E)";
$smtp->mail($me); # use the sender's address here
$smtp->to($to); # recipient's address
$smtp->data(); # Start the msg
# Send the header.
$smtp->datasend("Subject: Some subject\n"); # add subject line for looks
$smtp->datasend("To: $to\n");
$smtp->datasend("From: $me\n");
my $time = localtime(time);
$smtp->datasend("Date: $time\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
__END__
--
,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs