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

the mail() function

Moderators: macek, egami, gesf

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

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 php.net 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

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

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

You are probably missing some headers. Pleast post your code.

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

Code

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

I have tried 2 ways

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

$snd2 = ' \"/nocover\" <11111111111@faxcompany.com>';

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,"From: me@atmy.net<me@atmy.net>\n");
fputs($fp,"To: \"/nocover\" <11111111111@faxcompany.com>\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");
fputs($fp,"$email_content");
pclose($fp);
-------------------------------------------------------------------------------------
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 php.net under the mail.function page. This only caused it not to send

Thanks for any help


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 2 guests