Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SMTP Email 451 Error


Guest

Recommended Posts

For some reason, just out of the blue, I started getting this error when I try to send out email.

 

Warning: mail() [function.mail <http://www.php.net/function.mail>]: SMTP server response: 451 stray newline detected. see http://cr.yp.to/docs/smtplf.html in C:\web\admin\includes\classes\email.php on line 460

 

Warning: Cannot modify header information - headers already sent by (output started at D:\server\site\admin1\includes\classes\email.php:460) in C:\web\admin\includes\functions\general.php on line 18

 

 

Anyone seen this error before? Or have any idea how to fix it?

 

 

I'm currently running on milestone 1 on windows.

Again, note that before today, everything worked fine, no changes done to anything. So bizarre....

Link to comment
Share on other sites

On linux? Try changing admin > E-Mail Options > Line feed to LF rather than CR LF. Also make sure that you are using sendmail rather than SMTP.

 

On MS Windows, do the reverse.

 

There is also a bug report with a possibly related problem that had a code fix. You also might want to ask your host what they may have changed recently (if it was working and stopped, it's usually because the host upgraded something: qmail or PHP in this case).

 

Hth,

Matt

Link to comment
Share on other sites

Thanks for the info!

 

So our developers have resolved the issue already.

Here's the breakdown and summary of it (as acccurate as it seems from our perspective):

Our ISP have reported that their email service went down for a few minutes this morning and nothing else changed, but our guess is that they were upgrading something or change some servers around or brought up a backup server with different configurations.

 

This was our configuration that always worked before today:

- Windows OS

- smtp

- line feed set to LF

 

After our isp did their little change today, this is what we have to do to get email working again:

- Windows OS

- smtp

- line feed set to CRLF

- placed a \R in front of every \n that forms all of the email bodies (spread out in several files in the oscommerce file structure)

Link to comment
Share on other sites

  • 2 weeks later...
After our isp did their little change today, this is what we have to do to get email working again:

- Windows OS

- smtp

- line feed set to CRLF

- placed a \R in front of every \n that forms all of the email bodies (spread out in several files in the oscommerce file structure)

What exact files did you have to edit? And did this truly resolve it? I've put the line

 

$this->output = str_replace("\n", "\r\n", $this->output);

 

into email.php, and gotten it to send email, but multi-line emails end up with four blank lines instead of one. (Is that, perhaps, the result of something putting in \n\n instead of \r\n somehwere?)

 

As a side note, I've also discovered that you must set the sendmail_from value in php.ini to a real (or at least valid) email address. The default value of "@@ServerAdmin@@" ends up in the envelope MAIL FROM if you don't, and at least some mail servers (my ISP's among them) are configured to silently drop messages with bogus envelope from addresses as an anti-spam measure.

 

I took it to be some sort of Sendmail setting, and it's not. It's required to be set correctly on Win32 machines for SMTP to work reliably. I had to check session logs to catch it, because it wasn't generating any error messages.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...