edger1 has asked for the wisdom of the Perl Monks concerning the following question:
Hi. This surprised me, but my code below actually works to send an email! This site is great for the necessary programming help. Now I have a few questions on how can I make it better.
First, when the email is received, the "FROM" field is blank. How and where do I specify the person it is coming from?
Second, how do I specify the subject? Now, the first part of the body is in the subject line.
Last -- this one is not as important but I'm just curious -- is there a way to specify the date and time?
I am using WindowsXP Pro. I tried using both sendmail and the Mail module but to no success. Below is my code:
use strict; use Net::SMTP; my $recipient1 = 'john@hotmail.com'; my $smtp = Net::SMTP->new('mailhost.com', ); $smtp->mail ($ENV{USER}); $smtp->recipient($recipient1); $smtp->data(); $smtp->datasend("This is a test"); $smtp->datasend(); $smtp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Created script to send email but ending up with blank "FROM" field?
by bobf (Monsignor) on Sep 16, 2004 at 23:44 UTC | |
|
Re: Created script to send email but ending up with blank "FROM" field?
by rlb3 (Deacon) on Sep 16, 2004 at 22:44 UTC | |
|
Re: Created script to send email but ending up with blank "FROM" field?
by sgifford (Prior) on Sep 17, 2004 at 06:19 UTC | |
|
Re: Created script to send email but ending up with blank "FROM" field?
by edger1 (Initiate) on Sep 17, 2004 at 18:04 UTC | |
by iburrell (Chaplain) on Sep 17, 2004 at 21:36 UTC |