Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Mail() in violation of RFC822. Know of a work around

the mail() function

Moderators: macek, egami, gesf

Mail() in violation of RFC822. Know of a work around

Postby oohrah » Fri Sep 24, 2004 7:59 am

My problem is this. The From: field appears after the To: field. This is in
violation of RFC 822 and I am trying to use a faxing service called Send2fax well thier code adhears strickly to the the standard and because of the problem with mail, I can not get a fax to go through. I know I am sending the emails out because I have CC'd them to me. I also wrote code for using sendmail directly because I was informed this would correct the problem, however it did not. I am not pleading to the guru's on this board to please help me or give me some guiding light. On the function list there was post which said just set the first variable to null and let the header do the work, this also did not work. I am not traversed enough in cgi to write this function and am totally lost. Any help would be appriciated.

Thanks In Advanced
New php-forum User
New php-forum User
Posts: 2
Joined: Fri Sep 24, 2004 7:48 am

Postby Redcircle » Fri Sep 24, 2004 3:11 pm

You are probably missing some headers. Pleast post your code.
User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Postby oohrah » Sat Sep 25, 2004 3:20 pm

I have tried 2 ways

using mail() :
$headers1= "From:<>\";
$headers1 = "To: \"/nocover\" <>\n";
$headers1 .= "X-S2F-BillingInfo: Online Order From $site_name\n";
$headers1 .= "X-S2F-NotificationAddress: $email\n";
$headers1 .= "\r\n\r\n";

$snd2 = ' \"/nocover\" <>';

mail($snd2, $subject, $email_content, $headers1);
Fax comapny has told me everything else is fine just that the To field and the From Field is switched and that it is because the problem is within the mail() function they said they had found it on some board to be in violation of the RFC. I also confirmed this. They told me try through sendmail and it is the same thing. sendmail code below.

using sendmail diretly :
$fp = popen('/usr/sbin/sendmail -t','w');
fputs($fp,"To: \"/nocover\" <>\n");
fputs($fp,"X-S2F-BillingInfo: Online Order From $site_name\n");
fputs($fp,"X-S2F-NotificationAddress: $email\n");
fputs($fp,"Subject: $subject\n\n");
mail is send fine through both the only problem is, as stated before, the To and From fieds being switched no matter how I write the header. And the problem is the actually way the fax companies code is written because the conform strictly to the RFC standard and will not change. I have also tried to leave the first variable null in the mail() function as I found this on under the mail.function page. This only caused it not to send

Thanks for any help
New php-forum User
New php-forum User
Posts: 2
Joined: Fri Sep 24, 2004 7:48 am

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.