S
sanju.shah
After going thru the Active Perl documentation, I am playing with a
test email script. 2 issues i am facing:
1. When i get the email - the from & to address does not contain the
@company - it is only 'shah.com'
2. How do i attach attachments?
TIA,
Regards,
Sanju
Script:
use Net::SMTP;
$smtp = Net::SMTP->new('mailserver.company.com'); # connect to an SMTP
server
$smtp->mail( '(e-mail address removed)' ); # use the sender's address here
$smtp->to('(e-mail address removed)'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: (e-mail address removed)\n");
$smtp->datasend("From: (e-mail address removed)\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
test email script. 2 issues i am facing:
1. When i get the email - the from & to address does not contain the
@company - it is only 'shah.com'
2. How do i attach attachments?
TIA,
Regards,
Sanju
Script:
use Net::SMTP;
$smtp = Net::SMTP->new('mailserver.company.com'); # connect to an SMTP
server
$smtp->mail( '(e-mail address removed)' ); # use the sender's address here
$smtp->to('(e-mail address removed)'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: (e-mail address removed)\n");
$smtp->datasend("From: (e-mail address removed)\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection