Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SMTP Contribution - www.oscommerce.com/community/contributions,901


suhy

Recommended Posts

So, I know this will work; I just have to find out why I can't connect to the smtp server on this one domain.
I think that Ben's point is that you need to convince *them* that this will work. Otherwise, you might get stuck with a response, like "It must be a bug in your code. This works for others, so you need to debug your code and fix what is wrong." You should be able to provide a minimal test script (short enough for them to read and understand) that sends email from one domain and fails to send mail from this domain. Then they have to explain why the two domains are different rather than claiming that it is a code bug.

 

Part of the problem that you hit in these situations is that they will get contacted regularly by people with buggy code, where it is correct to respond with a "fix your code" message. You will get the best service if you can convince them quickly that the problem is on their side, rather than yours.

Always back up before making changes.

Link to comment
Share on other sites

  • Replies 339
  • Created
  • Last Reply

Hi Ben,

 

I red ALL this discussion, but I've not yet solved my problem.

 

Contact Us, admin email, tell a friend etc... I can't receive eMail from my oScommerce if I use a gmail account (I've got a personal domain based on gmail hosted service)

 

In admin>my store I put the same eMail without "" or <>.

I use IMAP and I configured my eMail options like this:

 

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

SMTP Server Host Address: sslv3://smtp.gmail.com

SMTP Server EHLO / HELO: gmail.com

SMTP Server Port Number: 587 (> because IMAP)

SMTP Authentication Required true

SMTP Authentication Username my username (like: [email protected])

SMTP Authentication Password my password

 

I did a test using another email NOT gmail and all works.

 

Why?

 

I installed the contribution version 8: 11 Jun 2009 and files "email.php"+"class.smtp.php" are in both folders.

 

:rolleyes:

 

Thank you very much for your answear.

Link to comment
Share on other sites

Hi Ben,

 

I red ALL this discussion, but I've not yet solved my problem.

 

Contact Us, admin email, tell a friend etc... I can't receive eMail from my oScommerce if I use a gmail account (I've got a personal domain based on gmail hosted service)

 

In admin>my store I put the same eMail without "" or <>.

I use IMAP and I configured my eMail options like this:

 

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

SMTP Server Host Address: sslv3://smtp.gmail.com

SMTP Server EHLO / HELO: gmail.com

SMTP Server Port Number: 587 (> because IMAP)

SMTP Authentication Required true

SMTP Authentication Username my username (like: [email protected])

SMTP Authentication Password my password

 

I did a test using another email NOT gmail and all works.

 

Why?

 

I installed the contribution version 8: 11 Jun 2009 and files "email.php"+"class.smtp.php" are in both folders.

 

:rolleyes:

 

Thank you very much for your answear.

Angelo,

 

Start by turning on the debug logic and send me the output via a PM. That should tell us what is going on.

 

You should be using your website domain name as the EHLO / HELO string, not gmail.com; however, that does not explain your problem (it's just the normal thing to do).

 

I'm not sure about the usage of [email protected] as the authentication username; I've always seen [email protected] used as a username. I'm not sure how a gmail hosted domain effects the anything. A guick look on gmail indicates that what you have done should work.

 

Let's start with the debug and see where that leads us.

 

BTW - IMAP has nothing to do with sending an email message; it is only used to receive email messages. The alternate port numbers are mostly due to history.

 

Ben

Link to comment
Share on other sites

Hi Ben

 

maybe I'm not able to activate DEBUG... :blush:

 

I have to delete slashes // before "$this->debug = FALSE;" and set TRUE?

 

// The follow variable when set to TRUE will cause the

// SMTP protocol exchange to be dumped to the browser window.

// The debug output represents ASCII CR and LF characters as \r and \n

// and is generally useful when dealing with SMTP configuration problems.

$this->debug = FALSE;

$this->log = "#EOL##EOL#SMTP debug enabled in class.smtp.php#EOL##EOL#";

}

Link to comment
Share on other sites

Hi Ben

 

maybe I'm not able to activate DEBUG... :blush:

 

I have to delete slashes // before "$this->debug = FALSE;" and set TRUE?

 

// The follow variable when set to TRUE will cause the

// SMTP protocol exchange to be dumped to the browser window.

// The debug output represents ASCII CR and LF characters as \r and \n

// and is generally useful when dealing with SMTP configuration problems.

$this->debug = FALSE;

$this->log = "#EOL##EOL#SMTP debug enabled in class.smtp.php#EOL##EOL#";

}

Angelo,

 

Just edit the file and replace

 

$this->debug = FALSE;

 

with

 

$this->debug = TRUE;

 

Save the changes and then use the contact us page to send an email. A log file should be created in the top level directory of the website (that directory must be writeable for the file to be created / updated).

 

After you send the message, download the file and paste the contents into a PM and send it to me.

 

Ben

Link to comment
Share on other sites

Hey peeps, im getting the following error after confirming an order from the shopping cart. (Im not using any modules for payment nor shipping)

SMTP Error: Could not connect to SMTP host. 
Warning: Cannot modify header information - headers already sent by (output started at /home/***/public_html/*********/includes/classes/phpmailer/class.phpmailer.php:527) in /home/***/public_html/*********/includes/functions/general.php on line 33

 

The store is hosted at hostmonster (shared hosting) however i use google apps to manage the email.

I followed these instructions for setting up the email.

 

E-Mail Transport Method smtp

E-Mail Linefeeds LF

Use MIME HTML When Sending Emails true

Verify E-Mail Addresses Through DNS false

Send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com

SMTP Server EHLO / HELO Name gmail.com

SMTP Server Port Number 465

SMTP Authentication Required true

SMTP Authentication Username [email protected] or gmail.com

SMTP Authentication Password #######

 

If anyone could of any assistance that would be much appreciated.

Cheers.

Link to comment
Share on other sites

Hey peeps, im getting the following error after confirming an order from the shopping cart. (Im not using any modules for payment nor shipping)

SMTP Error: Could not connect to SMTP host. 
Warning: Cannot modify header information - headers already sent by (output started at /home/***/public_html/*********/includes/classes/phpmailer/class.phpmailer.php:527) in /home/***/public_html/*********/includes/functions/general.php on line 33

 

The store is hosted at hostmonster (shared hosting) however i use google apps to manage the email.

I followed these instructions for setting up the email.

 

E-Mail Transport Method smtp

E-Mail Linefeeds LF

Use MIME HTML When Sending Emails true

Verify E-Mail Addresses Through DNS false

Send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com

SMTP Server EHLO / HELO Name gmail.com

SMTP Server Port Number 465

SMTP Authentication Required true

SMTP Authentication Username [email protected] or gmail.com

SMTP Authentication Password #######

 

If anyone could of any assistance that would be much appreciated.

Cheers.

 

UPDATE!!!

I realised i wasnt using the lastest contribution. However now i get the following errors.

 

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:587 (Connection timed out) in /home/***/public_html/***/includes/classes/class.smtp.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /home/holeinth/public_html/madsoundz/includes/classes/class.smtp.php:102) in /home/***/public_html/***/includes/functions/general.php on line 33

Link to comment
Share on other sites

UPDATE!!!

I realised i wasnt using the lastest contribution. However now i get the following errors.

 

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:587 (Connection timed out) in /home/***/public_html/***/includes/classes/class.smtp.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /home/holeinth/public_html/madsoundz/includes/classes/class.smtp.php:102) in /home/***/public_html/***/includes/functions/general.php on line 33

Your email linefeed parameter must be defined as CRLF with the protocol is set to SMTP (this does not explain your connection problem).

 

Did it use to work and now it stopped working or are you trying to get it working for the first time?

 

Ben

Link to comment
Share on other sites

  • 4 weeks later...

Can someone please throw some light on this one for me... Ive been trying DAYS now, to no avail :(

 

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails true

Verify E-Mail Addresses Through DNS false

Send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com (Tried tls://.smtp.gmail.com)

SMTP Server EHLO / HELO Name www.mydomain.com

SMTP Server Port Number 465 (Tried 587 too)

SMTP Authentication Required true

SMTP Authentication Username [email protected]

SMTP Authentication Password PASSWORD

 

All i get when i fill in the contact form is this error:

 

SMTP Error: Could not connect to SMTP host.

Warning: Cannot modify header information - headers already sent by (output started at /home/content/c/r/n/mydomain/html/catalog/includes/classes/phpmailer/class.phpmailer.php:527) in /home/content/c/r/n/mydomain/html/catalog/includes/functions/general.php on line 33

Link to comment
Share on other sites

Can someone please throw some light on this one for me... Ive been trying DAYS now, to no avail :(

 

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails true

Verify E-Mail Addresses Through DNS false

Send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com (Tried tls://.smtp.gmail.com)

SMTP Server EHLO / HELO Name www.mydomain.com

SMTP Server Port Number 465 (Tried 587 too)

SMTP Authentication Required true

SMTP Authentication Username [email protected]

SMTP Authentication Password PASSWORD

 

All i get when i fill in the contact form is this error:

 

SMTP Error: Could not connect to SMTP host.

Warning: Cannot modify header information - headers already sent by (output started at /home/content/c/r/n/mydomain/html/catalog/includes/classes/phpmailer/class.phpmailer.php:527) in /home/content/c/r/n/mydomain/html/catalog/includes/functions/general.php on line 33

Dean,

 

Is this a new problem (i.e., was it working before and it stopped working)?

 

Who is your hosting company? Do they have restrictions on outbound SMTP connections? Some hosting companies do not allow SMTP connections to originate from their servers. You will have to call and ask your hosting company about this one. Given the error message, this is the likely cause.

 

Is the name of your email account on gmail "[email protected]"? Typically it is "[email protected]". Everything else about your configuration parameters look correct.

 

Are you sure you posted your question in the right thread? The error message references a file (class.phpmailer.php) that is not part of this contribution; however, all of the configuration parameters suggest you have the SMTP Authentication contribution loaded. If you have the phpmailer contribution loaded, you may need to post your question elsewhere as I do not know where it gets the email configuration parameters from (it may not be the e-mail options sections).

 

Ben

Link to comment
Share on other sites

Dean,

 

Is this a new problem (i.e., was it working before and it stopped working)?

 

Who is your hosting company? Do they have restrictions on outbound SMTP connections? Some hosting companies do not allow SMTP connections to originate from their servers. You will have to call and ask your hosting company about this one. Given the error message, this is the likely cause.

 

Is the name of your email account on gmail "[email protected]"? Typically it is "[email protected]". Everything else about your configuration parameters look correct.

 

Are you sure you posted your question in the right thread? The error message references a file (class.phpmailer.php) that is not part of this contribution; however, all of the configuration parameters suggest you have the SMTP Authentication contribution loaded. If you have the phpmailer contribution loaded, you may need to post your question elsewhere as I do not know where it gets the email configuration parameters from (it may not be the e-mail options sections).

 

Ben

Dean,

 

Disregard my comment about posting your question in the right thread...I see someone has enhanced the contribution with a phpmailer capability.

 

Ben

Link to comment
Share on other sites

Hello Everybody,

 

not sure to be at the right place, if not, please tell me a better place

 

I try to use the contrib. 901, but I get a weird error when sending :

 

Message body empty

Warning: Cannot modify header information - headers already sent by (output started at /homez.22/mudplane/www/includes/classes/phpmailer/class.phpmailer.php:527) in ...

 

I have found a first error, line 507. Here is the file:

 

* @version $Id: class.phpmailer.php 447 2009-05-25 01:36:38Z codeworxtech $

 

504 $body = $this->CreateBody();

505

506 if (empty($this->Body)) {

507 throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL);

 

I think one should replace

 

506 if (empty($this->Body)) {

 

with

 

506 if (empty($body)) {

 

After this correction, I get another error !

 

Here it is :

 

SMTP Error: Could not authenticate.

Warning: Cannot modify header information - headers already sent by (output started at /homez.22/mudplane/www/includes/classes/phpmailer/class.phpmailer.php:528) in ...

 

Here is the code with throw the exception, in function SmtpConnect() :

 

679 $tls = ($this->SMTPSecure == 'tls');

680 $ssl = ($this->SMTPSecure == 'ssl');

681

682 if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) {

683

684 $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname());

685 $this->smtp->Hello($hello);

686

687 if ($tls) {

688 if (!$this->smtp->StartTLS()) {

689 throw new phpmailerException($this->Lang('tls'));

690 }

691

692 //We must resend HELO after tls negotiation

693 $this->smtp->Hello($hello);

694 }

695

696 $connection = true;

697 if ($this->SMTPAuth) {

698 if (!$this->smtp->Authenticate($this->Username, $this->Password)) {

699 throw new phpmailerException($this->Lang('authenticate'));

700 }

701 }

 

The throw is on line 699.

 

If I activate the debug mode, I receive this trace :

 

SMTP -> FROM SERVER:

SMTP -> FROM SERVER:

SMTP -> ERROR: EHLO not accepted from server:

SMTP -> FROM SERVER:

SMTP -> ERROR: HELO not accepted from server:

SMTP -> ERROR: AUTH not accepted from server:

SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate.

 

which does not helps me. I believe that some information is missing somewhere ... but I don't know where to investigate.

 

Anybody has an idea ?

 

Thanks a lot

Patrice

Link to comment
Share on other sites

Hello Everybody,

 

not sure to be at the right place, if not, please tell me a better place

 

I try to use the contrib. 901, but I get a weird error when sending :

 

Message body empty

Warning: Cannot modify header information - headers already sent by (output started at /homez.22/mudplane/www/includes/classes/phpmailer/class.phpmailer.php:527) in ...

 

I have found a first error, line 507. Here is the file:

 

* @version $Id: class.phpmailer.php 447 2009-05-25 01:36:38Z codeworxtech $

 

504 $body = $this->CreateBody();

505

506 if (empty($this->Body)) {

507 throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL);

 

I think one should replace

 

506 if (empty($this->Body)) {

 

with

 

506 if (empty($body)) {

 

After this correction, I get another error !

 

Here it is :

 

SMTP Error: Could not authenticate.

Warning: Cannot modify header information - headers already sent by (output started at /homez.22/mudplane/www/includes/classes/phpmailer/class.phpmailer.php:528) in ...

 

Here is the code with throw the exception, in function SmtpConnect() :

 

679 $tls = ($this->SMTPSecure == 'tls');

680 $ssl = ($this->SMTPSecure == 'ssl');

681

682 if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) {

683

684 $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname());

685 $this->smtp->Hello($hello);

686

687 if ($tls) {

688 if (!$this->smtp->StartTLS()) {

689 throw new phpmailerException($this->Lang('tls'));

690 }

691

692 //We must resend HELO after tls negotiation

693 $this->smtp->Hello($hello);

694 }

695

696 $connection = true;

697 if ($this->SMTPAuth) {

698 if (!$this->smtp->Authenticate($this->Username, $this->Password)) {

699 throw new phpmailerException($this->Lang('authenticate'));

700 }

701 }

 

The throw is on line 699.

 

If I activate the debug mode, I receive this trace :

 

SMTP -> FROM SERVER:

SMTP -> FROM SERVER:

SMTP -> ERROR: EHLO not accepted from server:

SMTP -> FROM SERVER:

SMTP -> ERROR: HELO not accepted from server:

SMTP -> ERROR: AUTH not accepted from server:

SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate.

 

which does not helps me. I believe that some information is missing somewhere ... but I don't know where to investigate.

 

Anybody has an idea ?

 

Thanks a lot

Patrice

Hi Patrice,

 

You might try sending an email to the author of the latest version of the contribution. His email address is listed in the Readme file.

 

You might try the prior version of the contribution (the last version I posted) or if you want a phpmailer version, there are a couple of other contributions based on it. Just search for "SMTP Auth" on the contribution page an you will find them.

 

Ben

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hi

I install the last contributions(11 Jun 2009), In catalog, The contributions is work well. but in admin, when I send a mail, it display success, but I can not recive the mail.

 

php.ini config:

 

; For Win32 only.

smtp = smtp.gmail.com

smtp_port = 465

 

; For Win32 only.

sendmail_from = *******@gmail.com

 

in admin email config:

 

Title Value Action

E-Mail sender smtp

E-Mail (Linefeeds) LF

use MIME HTML false

use DNS false

send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com

SMTP Server EHLO / HELO Name mailserver.net

SMTP Server Port Number 465

SMTP Authentication Required true

SMTP Authentication Username ******@gmail.com

SMTP Authentication Password ******

 

WHY?

Link to comment
Share on other sites

Hi

I install the last contributions(11 Jun 2009), In catalog, The contributions is work well. but in admin, when I send a mail, it display success, but I can not recive the mail.

 

php.ini config:

 

; For Win32 only.

smtp = smtp.gmail.com

smtp_port = 465

 

; For Win32 only.

sendmail_from = *******@gmail.com

 

in admin email config:

 

Title Value Action

E-Mail sender smtp

E-Mail (Linefeeds) LF

use MIME HTML false

use DNS false

send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com

SMTP Server EHLO / HELO Name mailserver.net

SMTP Server Port Number 465

SMTP Authentication Required true

SMTP Authentication Username ******@gmail.com

SMTP Authentication Password ******

 

WHY?

Change the E-Mail (linefeeds) parameter to CRLF -- This does not explain your problem; its just wrong.

 

Do you receive a Contact Us email message submitted by a user?

 

Ben

Link to comment
Share on other sites

Hi

I install the last contributions(11 Jun 2009), In catalog, The contributions is work well. but in admin, when I send a mail, it display success, but I can not recive the mail.

 

php.ini config:

 

; For Win32 only.

smtp = smtp.gmail.com

smtp_port = 465

 

; For Win32 only.

sendmail_from = *******@gmail.com

 

in admin email config:

 

Title Value Action

E-Mail sender smtp

E-Mail (Linefeeds) LF

use MIME HTML false

use DNS false

send E-Mails true

SMTP Server Host Address ssl://smtp.gmail.com

SMTP Server EHLO / HELO Name mailserver.net

SMTP Server Port Number 465

SMTP Authentication Required true

SMTP Authentication Username ******@gmail.com

SMTP Authentication Password ******

 

WHY?

 

E-Mail (Linefeeds) CRLF

 

i have the same problem, email function dont work. Im using xammp with php4 in my PC for test.

Link to comment
Share on other sites

E-Mail (Linefeeds) CRLF

 

i have the same problem, email function dont work. Im using xammp with php4 in my PC for test.

 

you should find the code in admin/include/class/email.php line 555:

$send_params['from'] = $from_addr;

change to:

$send_params['from'] = $params['user'];

 

I using on win2000+Xammp 1.068.It worked well. you can down from osCommerce

Link to comment
Share on other sites

  • 2 weeks later...

hi, I install the smtp mail on my shopping cart, but when I trying to send email to my customer, the page go blank, nothing shows... can someone experiencing this before?

thank you

ken

Link to comment
Share on other sites

hi, I install the smtp mail on my shopping cart, but when I trying to send email to my customer, the page go blank, nothing shows... can someone experiencing this before?

thank you

ken

Ken,

 

I can't say I've heard of this behavior. What version (date) of the contribution did you install? Do any of the email functions work? Does the Contact Us page work? Is the problem limited to the send email to customer function from the admin side of the website?

 

Ben

Link to comment
Share on other sites

  • 2 weeks later...

Hi, Ben

I install the cr2a version with my current shopping cart. After I install the contribution, customer can send email though front end, but I can not contact customer by email in back-end.

 

The other question I have is currently I using 1and1.com VPS, my all my store mail server is using 1and1 mail server, I did not using my currently VPS mail server, is this is the reason that making the contribution not working

thank you

 

ken

Link to comment
Share on other sites

Hi, Ben

I install the cr2a version with my current shopping cart. After I install the contribution, customer can send email though front end, but I can not contact customer by email in back-end.

 

The other question I have is currently I using 1and1.com VPS, my all my store mail server is using 1and1 mail server, I did not using my currently VPS mail server, is this is the reason that making the contribution not working

thank you

 

ken

Ken,

 

I can't help you too much with the 12 Nov version of the contribution. It was upgraded to use a new mailer class (PHPMailer 5) back in July of this year and it is not the same contribution. If you want to load the 11 Jun 2009 version, I can help debug any problems you might have with that version.

 

I don't think 1and1.com VPS or their mail servers are the problem. Usually it is just a configuration problem.

 

Ben

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I have a problem with the public part of this contrib (last version of 11/06/2009): I do not receive any mail through "Contact Us" and no order confirmation neither.

 

My params are as follow:

 

php.ini config:

 

; For Win32 only.

smtp = smtp.myserver.com

smtp_port = 25

 

; For Win32 only.

sendmail_from = [email protected]

 

in admin email config:

 

Title Value Action

E-Mail sender smtp

E-Mail (Linefeeds) CRLF

use MIME HTML true

use DNS true

send E-Mails true

SMTP Server Host Address smtp.myserver.com

SMTP Server EHLO / HELO Name mayserver.com

SMTP Server Port Number 25

SMTP Authentication Required true

SMTP Authentication Username ******

SMTP Authentication Password ******

 

Debug doesn't seem to work neither: I get no log in smtp.log when set to true...

 

Any idea ?

 

Sébastien

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...