Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Email Not Working Possible Solution


capersd

Recommended Posts

I have spent several days of my time trying to get this to work. In my orginal problem I was receiving the following error message anytime oscommerce attempted to send an email:

 

Warning: mail(): SMTP server response: 501 Syntax error in parameters or arguments in E:\Accounts\XXXXX\onstore\includes\classes\email.php on line 502

 

Warning: Cannot modify header information - headers already sent by (output started at E:\Accounts\XXXXXX\onstore\includes\classes\email.php:502) in E:\Accounts\XXXXXX\onstore\includes\functions\general.php on line 29

 

Mind you that this was a clean install from my ISP Provider on a Windows 2003 Server. ( Ishouldn't have had any problems with this since this was a product that my ISP offered, but I did)

 

After all the research this is what I did to correct the problem:

 

I installed the SMTP Authinication Contribution. http://www.oscommerce.com/community/contributions,901

 

I made the modifications to both email.php files and added the class.smtp.inc file in both locations as specified.

 

These are the changes I made to both email.php files:

 

if (EMAIL_TRANSPORT == 'smtp') {

// begin

 

include(DIR_WS_INCLUDES . '/classes/class.smtp.inc');

 

$params['host'] = '127.0.0.1'; // The smtp server host/ip

$params['port'] = 25; // The smtp server port

$params['helo'] = 'yourdomain.com'; // What to use when sending the helo command. Typically, your domain/hostname

$params['auth'] = TRUE; // Whether to use basic authentication or not

$params['user'] = '[email protected]'; // Username for authentication

$params['pass'] = 'XXXXXXX'; // Password for authentication

 

$send_params['recipients'] = array("$to_addr");

// The recipients (can be multiple)

$send_params['headers'] = array("From: [email protected] ", "To: $to_addr", "Subject: $subject");

$send_params['from'] = '[email protected]';

// This is used as in the MAIL FROM: cmd // It should end up as the Return-Path: header

$send_params['body'] = "$this->output";

// The body of the email

 

is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params);

 

 

// end the smtp } else {

 

}

}

 

==============================================

To get this to work, I had to remove this line from email.php

return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));

 

after the else statement of the code.

 

==============================================

 

 

After these changes were made I updated the email configuration within the admin to:

 

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails false

Verify E-Mail Addresses Through DNS false

Send E-Mails true

 

ANY OTHER SETTINGS DO NOT SEEM TO WORK

and you have to clear out the entire field in your store setup that allows you to send extra order emails to another address. (This doesn't seem to work with the smtp contribution) http://www.oscommerce.com/community/contributions,901

 

 

 

MY ISP told me that I had to set the settings to my SMTP Server to 127.0.0.1 in the email.php and class.smtp.inc files.

 

I didn't have it setup like that in the beginning and my emails were being sent but undelievered.

 

Once I did all this, the email function works now except for the Contact page. (I don't really care about this page so I replaced the links to the contact page with a mailto email address)

 

The one thing that I would like help on is somehow editing the email file to send me personally a copy of every email that the system sends out. The send extra order email option doesn't work with this setup, and I really need to receive somekind of confirmation when someone places an order or creates an account.

 

Thanks, Your help would be greatly appreciated.

Daymon

Link to comment
Share on other sites

The send extra order email option doesn't work with this setup

I have the same config & same problem:

I think this form is wrong: Name 1 <email@address1>

try this one: email@address1

 

salute

rai

Link to comment
Share on other sites

You can not enter anything within the send extra emails field. When you do you get this error message:

 

Fatal error: Cannot redeclare class smtp in E:\Accounts\parkways\onstore\includes\classes\class.smtp.inc on line 12

 

 

 

But I did find out that if you modified the line around 502 in email.php from

include(DIR_WS_INCLUDES . '/classes/class.smtp.inc');

to:

include_once(DIR_WS_INCLUDES . '/classes/class.smtp.inc');

you can put just the email address in the send extra email field in admin configuration and it will actually work now.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...