in reply to Created script to send email but ending up with blank "FROM" field?
I know you said you are using Net::SMTP, but since you tried using sendmail without success I thought I'd give you an example that works for me (with WinXP). Perhaps it will come in handy in the future.
use strict; use warnings; use Mail::Sendmail; my %mail; # set smtp mail server (IP xxx.xxx.xxx.xxx) $mail{smtp} = 'mail.server.edu'; # set mail info $mail{To} = 'recipient1@foo.com'; $mail{CC} = 'recipient2@foo.com'; $mail{bcc} = 'recipient1@bar.edu'; $mail{From} = 'recipient1@baz.org'; $mail{Subject} = 'testing'; $mail{Message} = "hi"; # send the email sendmail( %mail ) or die $Mail::Sendmail::error;
HTH
|
|---|