in reply to Hand-rolled CGI mailto
People have explained what's wrong with your web code. Now I'll explain what's wrong with your mail code!
An SMTP message is made up of a series of headers, followed by a blank line, followed by the body of the message. Just putting a blank line in your Perl source code is not sufficient to put a blank line in the e-mail message...
By and large, you should avoid talking to sendmail directly. Use a Perl module instead to save you from having to worry about the nitty-gritty details. Here's how you could send the message with Mail::Sendmail:
use Mail::Sendmail; sendmail( To => $to, From => $from, Subject => $subject, Body => <<END_OF_BODY, Name: $name EMail: $email Address_line_1: $address1 Address_line_2: $address2 City: $city State: $state Zip: $zip Home_Phone: $homephone Work_Phone: $workphone Type_of_Business: $business Goals: $goals Comments: $comments END_OF_BODY ) or print "Failed to send message [$subject] to [$to]: $Mail::Sendmai +l::error\n";
Hope this helps.
update: corrected a silly bug in the heredoc syntax (forgot the <<).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Hand-rolled CGI mailto (use a module to send e-mail)
by bradcathey (Prior) on Dec 17, 2003 at 14:56 UTC | |
|
Re: Re: Hand-rolled CGI mailto (use a module to send e-mail)
by Gerard (Pilgrim) on Dec 18, 2003 at 01:53 UTC | |
|
Re^2: Hand-rolled CGI mailto (use a module to send e-mail)
by Nkuvu (Priest) on Dec 17, 2003 at 17:43 UTC |