osCommerce 2.2 RC2 Windows (Win32) and mail 501 5.5.4 Invalid Address

October 1, 2008

PHP contains bug in the Win32 code which prevents most php to work corrently with sending emails.

The overall idea of solution (workaround) is to do not use NAME with EMAILS. So both TO and FROM fields must be in form “TO: john@localhost.org” or “FROM: john@localhost.org” but not “TO: “John Doe” <john@localhost.org>”

I recently encountered this problem with osCommerce.

Solution to overcome this:

  1. I added define to both includes\configure.php and admin\includes\configure.phpdefine(‘WIN32′, true);

  2. Then in includes\classes\emails.php and admin\includes\classes\email.php in “send” function find this lines:$to = (($to_name != ”) ? ‘”‘ . $to_name . ‘” <’ . $to_addr . ‘>’ : $to_addr);
    $from = (($from_name != ”) ? ‘”‘ . $from_name . ‘” <’ . $from_addr . ‘>’ : $from_addr);

    and place following code BELOW them:

    //WIN32 FIX
    if (WIN32) {
    $from = $from_addr;
    $to = $to_addr;
    }

That’s all, and now I can test email sending on my local win maching. Good luck!

Entry Filed under: oscommerce, php. Tags: , , , , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

October 2008
M T W T F S S
« Jun    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Most Recent Posts