Posts filed under ‘php’

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

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!

Advertisements

October 1, 2008 at 10:22 pm 2 comments


Calendar

October 2017
M T W T F S S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Posts by Month

Posts by Category