You need to leave off the single quotes around $from_address, $to_address,
and $subject.
%mail = (
SMTP => 'finster.scd.ucar.edu',
from => $from_address,
to => $to_address,
subject => $subject,
);
Mar 28, 2003 at 12:12pm from Robbie Staufer:
RS> Hi,
RS>
RS> I have a perl script that takes in form data and generates and email
RS> with the data to be sent to me. I'm getting the error message
RS> Error:Bad or missing From address: '$from_address'. The webmaster says
RS> I'm using the correct from address, so, any ideas about this error message?
RS>
RS> Thanks.
RS> Robbie
RS>
RS> Here's what I have:
RS>
RS> ### send mail #####
RS>
RS> $from_address = "[EMAIL PROTECTED]";
RS> $to_address = "[EMAIL PROTECTED]";
RS> $subject = "ESMF Registration Form";
RS>
RS> %mail = (
RS> SMTP => 'finster.scd.ucar.edu',
RS> from => '$from_address',
RS> to => '$to_address',
RS> subject => '$subject',
RS> );
RS>
RS> $mail{body} = <<END_OF_BODY;
RS>
RS> First Name: $fname
RS> Last Name: $lname
RS> Email: $email
RS> Organization: $org
RS> Scientific Interest: $sci_int
RS> Mailing List? $check
RS>
RS> sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";
RS>
RS>
RS>
--
http://emerson.wss.yale.edu/perl
Pete Emerson
WSS AM&T Yale University
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]