Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Created script to send email but ending up with blank "FROM" field?

by iburrell (Chaplain)
on Sep 17, 2004 at 21:36 UTC ( [id://391904]=note: print w/replies, xml ) Need Help??


in reply to Re: Created script to send email but ending up with blank "FROM" field?
in thread Created script to send email but ending up with blank "FROM" field?

No surprise it doesn't work; it doesn't compile. You were on the right path in the first code. Just send the complete email message with datasend. Most importantly, send the header with To:, From:, Subject:, and blank line separating it from the body.
use strict; use Net::SMTP; my $sender = $ENV{USER}; my $recipient1 = 'john@hotmail.com'; my $smtp = Net::SMTP->new('mailhost.com'); $smtp->mail($sender); $smtp->recipient($recipient1); $smtp->data(); $smtp->datasend("To: $recipient1"); $smtp->datasend("From: $sender"); $smpt->datasend("Subject: some subject"); $smtp->datasend(""); $smtp->datasend("This is the body"); $smtp->datasend(""); $smtp->quit;
  • Comment on Re^2: Created script to send email but ending up with blank "FROM" field?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://391904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found