Unfortunately, that code gave me a parse error.
"R'Twick Niceorgaw" <[EMAIL PROTECTED]> wrote in message 04af01c179d5$3503f010$[EMAIL PROTECTED]">news:04af01c179d5$3503f010$[EMAIL PROTECTED]... > Eric, > Here is what I believe will work. > You need to put \r\n after the From Header and after the X-Mailer header. > I have moved the from and X-Mailer to a separate header for clarity. > try it and let me know if you still getting the same error. > > Good luck > > function SendSite($yname, $ymail, $fname, $fmail) { > global $sitename, $slogan, $nukeurl, $ModName; > $subject = ""._INTSITE." $sitename"; > $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._OURSITE." > $sitename "._INTSENT."\n\n\n"._FSITENAME." > $sitename\n$slogan\n"._FSITEURL." > $nukeurl"; > > > $Headers = "From: $yname<$ymail>\r\n"; > $Headers.="X-Mailer: PHP/" . phpversion()."\r\n"; > > > mail($fmail, $subject, $message, $Headers); > > // Header("Location: friend.php?op=SiteSent&fname=$fname"); > // Original commented out by adam_baum 07-07-2001 when moved to a > module. > echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"1; > URL=modules.php?op=modload&name=$ModName&file=index\">"; > echo "</head><body></body></html>"; > } > > ----- Original Message ----- > From: "Eric Rosebrock" <ERIC@(NOSPAM) 3dhavoc.net> > To: <[EMAIL PROTECTED]> > Sent: Friday, November 30, 2001 2:11 PM > Subject: Re: [PHP-WIN] BARE LF in Sending Mail from PHP > > > > Ok, > > > > I am going to try go go into as much detail as I can for this one. I have > > done some modifications of the certain script that I am using and I am > > getting --- somewhere --- > > > > Starting off, Here's the original script and a copy of the mail log from > my > > mail server for this transacition. > > > > Original Script: > > > > } > > > > function SendSite($yname, $ymail, $fname, $fmail) { > > global $sitename, $slogan, $nukeurl, $ModName; > > $subject = ""._INTSITE." $sitename"; > > $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._OURSITE." > > $sitename "._INTSENT."\n\n\n"._FSITENAME." > $sitename\n$slogan\n"._FSITEURL." > > $nukeurl\n"; > > mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: > > PHP/" . phpversion()); > > // Header("Location: friend.php?op=SiteSent&fname=$fname"); > > // Original commented out by adam_baum 07-07-2001 when moved to a > > module. > > echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"1; > > URL=modules.php?op=modload&name=$ModName&file=index\">"; > > echo "</head><body></body></html>"; > > } > > > > Mail Log from the original script through my smtp server and where it > fails > > from the QMail server it's sending to: > > > > Thread 1: 18:58:53 [<---] : HELO xxxxxx.net > > Thread 1: 18:58:53 [--->] : 220 xxxxx.net ESMTP > > Thread 1: 18:58:53 [<---] : MAIL FROM: <[EMAIL PROTECTED]> > > Thread 1: 18:58:54 [--->] : 250 xxxxxxx.net > > Thread 1: 18:58:54 [<---] : RCPT TO: <[EMAIL PROTECTED]> > > Thread 1: 18:58:54 [--->] : 250 ok > > Thread 1: 18:58:54 [<---] : DATA > > Thread 1: 18:58:54 [--->] : 250 ok > > Thread 1: 18:58:54 [--->] : 354 go ahead > > Thread 1: 18:58:54 [<---] : QUIT > > Thread 1: 18:58:54 [--->] : 451 See > http://pobox.com/~djb/docs/smtplf.html. > > > > > > > > Modified Script (I tried to put the carriage returns in, but I think I am > > missing something): > > > > } > > > > function SendSite($yname, $ymail, $fname, $fmail) { > > global $sitename, $slogan, $nukeurl, $ModName; > > $subject = ""._INTSITE." $sitename"; > > $message = ""._HELLO." $fname:\r\n"._YOURFRIEND." $yname "._OURSITE." > > $sitename "._INTSENT."\r\n"._FSITENAME." > > $sitename\r\n$slogan\r\n"._FSITEURL." $nukeurl\r\n"; > > mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: > > PHP/" . phpversion()); > > // Header("Location: friend.php?op=SiteSent&fname=$fname"); > > // Original commented out by adam_baum 07-07-2001 when moved to a > > module. > > echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"1; > > URL=modules.php?op=modload&name=$ModName&file=index\">"; > > echo "</head><body></body></html>"; > > } > > > > > > Mail log from the modified script through my SMTP server and it doesnt > > display an error message or anything at all on the last line: > > > > Thread 1: 19:51:58 [<---] : HELO xxxxx.net > > Thread 1: 19:51:58 [--->] : 220 xxxxxx.net ESMTP > > Thread 1: 19:51:58 [<---] : MAIL FROM: <[EMAIL PROTECTED]> > > Thread 1: 19:51:58 [--->] : 250 xxxxxxx.net > > Thread 1: 19:51:58 [<---] : RCPT TO: <[EMAIL PROTECTED]> > > Thread 1: 19:51:58 [--->] : 250 ok > > Thread 1: 19:51:58 [<---] : DATA > > Thread 1: 19:51:59 [--->] : 250 ok > > Thread 1: 19:51:59 [--->] : 354 go ahead > > Thread 1: 19:51:59 [<---] : QUIT > > Thread 1: 19:51:59 [--->] : > > > > Notice the last line is different from above? There's no error message > > displayed, but it doesn't look like this below. Below is a test email that > I > > sent through MS Outlook using the same SMTP server to the same email > address > > I am having problems sending to via a php form. > > > > Here's a successful transaction from outlook to the same SMTP server: > > > > Thread 1: 19:57:15 [<---] : HELO xxxxx.net > > Thread 1: 19:57:15 [--->] : 220 xxxxxx.net ESMTP > > Thread 1: 19:57:15 [<---] : MAIL FROM: <[EMAIL PROTECTED]> > > Thread 1: 19:57:15 [--->] : 250 xxxxxx.net > > Thread 1: 19:57:15 [<---] : RCPT TO: <[EMAIL PROTECTED]> > > Thread 1: 19:57:15 [--->] : 250 ok > > Thread 1: 19:57:15 [<---] : DATA > > Thread 1: 19:57:16 [--->] : 250 ok > > Thread 1: 19:57:16 [--->] : 354 go ahead > > Thread 1: 19:57:16 [<---] : QUIT > > Thread 1: 19:57:16 [--->] : 250 ok 1007147007 qp 30206 > > > > > > I hope this detail will help us solve this problem! > > > > Note: This same script works excellent on a sendmail server on a linux > box. > > I have tried 6 different SMTP servers and that's obviously not the > problem. > > My problem is I am running on a Win2k machine with Apache and php 4.06 > > > > Thanks, > > Eric > > > > "Ryan Marrs" <[EMAIL PROTECTED]> wrote in message > > EA9290E62E6CD311859200805F85164903C5B437@EXCHANGE">news:EA9290E62E6CD311859200805F85164903C5B437@EXCHANGE... > > > I think the issue here is you need to convert the \n to be \r\n which is > > > CRLF (Carriage Return - Line Feed) it's not a bug in PHP. Good luck, > and > > I > > > hope this helps. > > > > > > Ryan > > > > > > > > > -----Original Message----- > > > From: Eric Rosebrock [mailto:ERIC@ 3dhavoc.net] > > > Sent: Friday, November 30, 2001 12:59 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP-WIN] BARE LF in Sending Mail from PHP > > > > > > Ok, this particular script (one of many) is sending the email. > > > > > > If you can show me how to fix this one, I can probably recode the rest > of > > > them. > > > > > > I believe this is the part sending the mail: > > > > > > function SendStory($sid, $yname, $ymail, $fname, $fmail) { > > > global $sitename, $nukeurl, $pntable, $ModName; > > > > > > $result2=mysql_query("select title, time, topic from > $pntable[stories] > > > where sid=$sid"); > > > list($title, $time, $topic) = mysql_fetch_row($result2); > > > > > > $result3=mysql_query("select topictext from $pntable[topics] where > > > topicid=$topic"); > > > list($topictext) = mysql_fetch_row($result3); > > > > > > $subject = ""._INTERESTING." $sitename"; > > > $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname > > > "._CONSIDERED."\n\n\n$title\n("._FDATE." $time)\n"._FTOPIC." > > > $topictext\n\n"._URL.": $nukeurl/article.php?sid=$sid\n\n"._YOUCANREAD." > > > $sitename\n$nukeurl"; > > > mail($fmail, $subject, $message, "From: \"$yname\" > <$ymail>\nX-Mailer: > > > PHP/" . phpversion()); > > > $title = urlencode($title); > > > $fname = urlencode($fname); > > > //Header("Location: > > friend.php?op=StorySent&title=$title&fname=$fname"); > > > // Original commented out by adam_baum 07-07-2001 when moved to a > > > module. > > > echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"1; > > > URL=modules.php?op=modload&name=$ModName&file=index\">"; > > > echo "</head><body></body></html>"; > > > > > > > > > > > > "R'Twick Niceorgaw" <[EMAIL PROTECTED]> wrote in message > > > 048001c179c4$0a711aa0$[EMAIL PROTECTED]">news:048001c179c4$0a711aa0$[EMAIL PROTECTED]... > > > > What I believe, and as pointed out at > > > > http://pobox.com/~djb/docs/smtplf.html. > > > > mail servers require each line to end with a \r\n ( CARRIAGE RETURN > > > > + LINE FEED) not just \n(LINE FEED). So, try appending a "\r\n" to the > > end > > > > of each line ( mail headers and body) in your PHP script and see if > > that > > > > fixes it. > > > > > > > > If you can post the php mail code you are using to send mail, then > > > probably > > > > some one can figure out more precisely where you are missing the CR. > > > > > > > > Alternatively, use phpmailer (http://phpmailer.sourceforge.net/ ) > its > > a > > > > nice program that will does all these dirty work.. > > > > > > > > HTH > > > > R'twick > > > > ----- Original Message ----- > > > > From: "Eric Rosebrock" <ERIC@(NOSPAM) 3dhavoc.net> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Friday, November 30, 2001 10:39 AM > > > > Subject: [PHP-WIN] BARE LF in Sending Mail from PHP > > > > > > > > > > > > > Hey there, I posted this on the Php.net bug reporting site. Was > > > wondering > > > > if > > > > > anyone else has noticed the same thing and found a fix for it. > > > > > -------------------------- > > > > > I am running an apache web server using PHP 4.06 on Windows 2000 > > Server > > > > and > > > > > Windows XP (so > > > > > we know it doesn't matter the OS as long as it's MS and PHP). Now > > here's > > > > my > > > > > delima. > > > > > > > > > > I can send emails through MS Outlook to my specified mail address > just > > > > fine. > > > > > There's no > > > > > problems and it gets delivered right away. But when I try sending an > > > email > > > > > through a web > > > > > form, the unix mail server running QMail rejects it with an error > 451 > > > Bare > > > > > LF. > > > > > > > > > > Here's an example: > > > > > > > > > > This email was sent from my Outlook Client through Postcast Email > > Server > > > > > Succesfully (I > > > > > have XXXX out server names for my protection): > > > > > > > > > > Thread 1: 23:51:23 [<---] : HELO xxxx.xxxxxx.net > > > > > Thread 1: 23:51:23 [--->] : 220 gambit.xxxxxx.net ESMTP > > > > > Thread 1: 23:51:23 [<---] : MAIL FROM: <[EMAIL PROTECTED]> > > > > > Thread 1: 23:51:23 [--->] : 250 gambit.xxxxxx.net > > > > > Thread 1: 23:51:23 [<---] : RCPT TO: <[EMAIL PROTECTED]> > > > > > Thread 1: 23:51:23 [--->] : 250 ok > > > > > Thread 1: 23:51:23 [<---] : DATA > > > > > Thread 1: 23:51:23 [--->] : 250 ok > > > > > Thread 1: 23:51:23 [--->] : 354 go ahead > > > > > Thread 1: 23:51:23 [<---] : QUIT > > > > > Thread 1: 23:51:24 [--->] : 250 ok 1007074661 qp 3355 > > > > > > > > > > Now, this email was sent via a php script form through Postcast (I > > have > > > > XXXX > > > > > out server > > > > > names for my protection): > > > > > > > > > > Thread 1: 23:37:55 [<---] : HELO xxxxxx.xxxxxx.net > > > > > Thread 1: 23:37:55 [--->] : 220 gambit.xxxxxx.net ESMTP > > > > > Thread 1: 23:37:55 [<---] : MAIL FROM: <[EMAIL PROTECTED]> > > > > > Thread 1: 23:37:55 [--->] : 250 gambit.xxxxx.net > > > > > Thread 1: 23:37:55 [<---] : RCPT TO: <[EMAIL PROTECTED]> > > > > > Thread 1: 23:37:55 [--->] : 250 ok > > > > > Thread 1: 23:37:55 [<---] : DATA > > > > > Thread 1: 23:37:55 [--->] : 250 ok > > > > > Thread 1: 23:37:56 [--->] : 354 go ahead > > > > > Thread 1: 23:37:56 [<---] : QUIT > > > > > Thread 1: 23:37:56 [--->] : 451 See > > > > http://pobox.com/~djb/docs/smtplf.html. > > > > > > > > > > > > > > > So what's the problem here? Do you think it could be that PHP 4.06 > is > > > > > spitting out these > > > > > bare LF or what? I mean it's obvious that Postmaster Email Server is > > > > sending > > > > > the mails > > > > > just fine from Outlook and Outlook is the source of the mail that > sent > > > > > succesfully, and > > > > > the PHP script is the one that sent Unsuccessfully. > > > > > > > > > > I have tried at least 6 different SMTP servers for the win32 > operating > > > > > systems. They all > > > > > do the same thing. This is very bad for me because I am having > extreme > > > > > difficulties > > > > > running my site if every member signs up that has a unix email > account > > > > > running on Qmail, > > > > > pukes on me and I have to send the emails directly to them. It's > > > strange. > > > > > > > > > > I hope we can figure this one out. I have researched the net but not > > any > > > > > information on > > > > > this particular configuration. > > > > > I would like to add that I have tried a perl script to send emails > and > > > it > > > > > works fine. No > > > > > bare LF. However, I tried to install Sendmail for Windows and I > could > > > not > > > > > get that to run > > > > > from php. So... we are back to square 1. Trying to get the Bare LF > out > > > of > > > > > SMTP. > > > > > Thanks,Eric Rosebrockhttp://wolfenstein.3dhavoc.net > > > > > > > > > > > > > > > > > > > > -- > > > > > PHP Windows Mailing List (http://www.php.net/) > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]