Posts filed under ‘oscommerce’

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!

October 1, 2008 at 10:22 pm 2 comments


Calendar

August 2017
M T W T F S S
« Oct    
 123456
78910111213
14151617181920
21222324252627
28293031  

Posts by Month

Posts by Category