Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


suhy

Recommended Posts

Here goes guys!

 

I have a Windows Shared Server with OSC v.2.2 RC2a running. I have just installed the SMTP mod, which I used on my last installation and it seems that none of the e-mail functions work, except the visitor contact page?

 

Before this installation I had a previous installation that worked fine with the SMTP working!

 

My e-mail settings are as follow...

 

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: authsmtp.streamline.net
SMTP Server EHLO / HELO Name: srsmotorcycles.co.uk
SMTP Server Port Number: 25
SMTP Authentication Required: true
SMTP Authentication Username: [email protected]
SMTP Authentication Password: mail_box_password

Can anyone spot anything out of place?

 

I have tried playing with the settings but still can't get it going?! :rolleyes:

 

Your settings look OK.

 

Turn on the debug capability (per the readme). Let's see what it tells us.

 

Ben

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 339
  • Created
  • Last Reply

've never had order notifications or contact us form working, since the site went live sad.gif

 

Keep getting this error when submitting the contact us form...

 

 

 

Warning: fsockopen(): unable to connect to mail.rousie.co.uk:25 in /home/content/c/r/n/crnproducts/html/catalog/includes/classes/class.smtp.php on line 102

string(52) "

 

SMTP debug enabled in class.smtp.php

 

"

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

 

Tried allsorts of settings to get it working.

 

Site is hosted with Godaddy, but i am trying to use my SMTP relays from Hostgator account to get it working and still no joy sad.gif

 

Anyone shed any light?

 

Thanks all,

Dean

Link to comment
Share on other sites

've never had order notifications or contact us form working, since the site went live sad.gif

 

Keep getting this error when submitting the contact us form...

Warning: fsockopen(): unable to connect to mail.rousie.co.uk:25 in /home/content/c/r/n/crnproducts/html/catalog/includes/classes/class.smtp.php on line 102

string(52) "

 

SMTP debug enabled in class.smtp.php

 

"

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

 

Tried allsorts of settings to get it working.

 

Site is hosted with Godaddy, but i am trying to use my SMTP relays from Hostgator account to get it working and still no joy sad.gif

 

Anyone shed any light?

 

Thanks all,

Dean

Dean,

 

I searched the Hostgator site and found this page on email configuration. Based on it, your configuration parameters should be:

 

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails false

Verify E-Mail Addresses Through DNS true

Send E-Mails true

SMTP Server Host Address mail.rousie.co.uk

SMTP Server EHLO / HELO Name your_domain_name

SMTP Server Port Number 25

SMTP Authentication Required true

SMTP Authentication Username your_email_name

SMTP Authentication Password your_email_password

 

 

Use the domain name of your store in place of your_domain_name (e.g., www.mystore.com)

Use your Hostgator email address and password instead of your_email_* (e.g., [email protected] ...)

 

If you get the same fsockopen() error message, try changing the port number to 26.

 

Ben

Link to comment
Share on other sites

Thanks for that, but i still get the same error, on Port 25 or 26.... Do i have to manually edit the class.smtp.php file to include this information too? I ask, as i remember changing it before...

 

Dean

 

Error:

Warning: fsockopen(): unable to connect to mail.rousie.co.uk:25 in /home/content/c/r/n/crnproducts/html/catalog/includes/classes/class.smtp.php on line 102

string(52) "

 

SMTP debug enabled in class.smtp.php

 

"

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

Link to comment
Share on other sites

I have also noticed THIS in my Cpanel email authentication settings...

 

 

------

Additional Hosts that send mail for your domains (A):

All the hosts you specify here will be approved for sending mail. You do not need to specify your primary mail exchanger or any server that an mx has been created for as they are already included automatically.

 

Additional MX servers for your domains (MX):

All the mx entries for every domain you specify here will be approved for sending mail.

 

Additional Ip blocks for your domains (IP4):

All the ip blocks you specify here will be approved for sending mail. Blocks should be specified in CIDR format (ie 127.0.0.1/32).

 

Include List (INCLUDE):

The SPF settings for all hosts your specify in this list will be included with your SPF settings. This is useful if you will be sending mail though another service (ex. mac.com, comcast.com, etc).

 

All Entry (ALL):

If you are sure you have entered all hosts (your primary mail exchanger and any other mx entries are automatically included) that will send mail for your domain, check this box to exclude all other domains.

 

Overwrite Existing Entries:

If you select this option all existing SPF records will be overwritten for all your domains with these selections.

---

Link to comment
Share on other sites

Also, on another note: What should my class.smtp.php file look like? I ask, as i may have naffed something up in that...

 

I would appreciated it if you could post the code up here, and enter the info that i would need to be in there (like my mail settings, etc)

 

Dean

Link to comment
Share on other sites

Dean,

 

You do not need to edit class.smtp.php to enter the email parameters. You only need to edit the file to enable / disable the debug capability.

 

The email parameters are defined on the osCommerce admin -> configuration -> E-mail options page.

 

If you are unsure of the state of your class.smtp.php file, download the current version of the contribution, open the zip file and copy the class.smtp.php file to the includes/classes and admin/includes/classes directories on your website. The file is way to long to post here.

 

I'm not sure how Cpanel might be effecting your site. I'm not hosted in a Cpanel environment. My website is hosted on a GoDaddy linux server.

 

The Cpanel setting that sounds most promising is the Include List which is used to define SPF settings. It is the only one that sounds like it applies to your situation.

 

Have you tried to get the email working with the GoDaddy email servers?

 

Ben

Link to comment
Share on other sites

Right, re-downloaded the full contrib and updated the one on my website...

 

Still the same. on ports 25 or 26

 

These are my settings in the Admin Panel....

 

E-Mail Transport Method  	              smtp
E-Mail Linefeeds 	                          CRLF
Use MIME HTML When Sending Emails   false 
Verify E-Mail Addresses Through DNS    true 	
Send E-Mails 	                                    true 
SMTP Server Host Address 	           mail.rousie.co.uk 	
SMTP Server EHLO / HELO Name 	      crnproducts.co.uk 	
SMTP Server Port Number 	           26 	 
SMTP Authentication Required 	           true 
SMTP Authentication Username 	         crn+rousie.co.uk
SMTP Authentication Password 	         ***********

 

 

RE: Godaddy, tried to use godaddy email at first, which worked for a while, then stopped all together.... Maybe it was my settings in Admin? If you think so, post up what i should have in the settings if i were to use GoDaddy....

 

Thank YOU!

 

Dean

Link to comment
Share on other sites

Oh, and now with debug on :)

 

Warning: fsockopen(): unable to connect to mail.rousie.co.uk:25 in /home/content/c/r/n/crnproducts/html/catalog/includes/classes/class.smtp.php on line 102

array(1) { [0]=> string(49) "Failed to connect to server: Connection timed out" } string(52) "

 

SMTP debug enabled in class.smtp.php

 

" array(2) { [0]=> string(49) "Failed to connect to server: Connection timed out" [1]=> string(14) "Not connected!" } string(52) "

 

SMTP debug enabled in class.smtp.php

 

"

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

Link to comment
Share on other sites

Right, re-downloaded the full contrib and updated the one on my website...

 

Still the same. on ports 25 or 26

 

These are my settings in the Admin Panel....

 

E-Mail Transport Method  	              smtp
E-Mail Linefeeds 	                          CRLF
Use MIME HTML When Sending Emails   false 
Verify E-Mail Addresses Through DNS    true 	
Send E-Mails 	                                    true 
SMTP Server Host Address 	           mail.rousie.co.uk 	
SMTP Server EHLO / HELO Name 	      crnproducts.co.uk 	
SMTP Server Port Number 	           26 	 
SMTP Authentication Required 	           true 
SMTP Authentication Username 	         crn+rousie.co.uk
SMTP Authentication Password 	         ***********

RE: Godaddy, tried to use godaddy email at first, which worked for a while, then stopped all together.... Maybe it was my settings in Admin? If you think so, post up what i should have in the settings if i were to use GoDaddy....

 

Thank YOU!

 

Dean

Dean,

 

Your SMTP Authentication Username does not look like a valid email address (the "+" symbol). It should be something like "[email protected]".

 

Ben

Link to comment
Share on other sites

Please help: fsockopen(): enable to connect.....

 

 

I had trouble sending email, so I installed smtp-auth-update_6.

Still have trouble.

I know, in order to get some help I need to provide as much as I can. Here it is:

 

1. I know for sure that my server uses port 25: this port works fine in Outlook Express to send/receive mail with this host.

Outlook Express was set using registry key generated by host to easy Outlook setup.

 

2. Host based on Linux

3. The info of e-mail manager on the host says: POP3/IMAP/SMTP Mail Server : mbox.freehostia.com

so I entered into SMTP Host Address: mbox.freehostia.com

4. Entered freehostia.com into SMTP Server EHLO/HELO name

5. Entered my email address into username, something like [email protected]

6 Entered my email password into password

7 Tried Authentication true or false, didn't find any difference

8 Tried linefeeds LF or CRLF (no diff)

9 tried Transport method smtp/sendmail (with smtp i got that famous message fsockopen(): enable to connect...), with sendmail it just can't open next page.

 

Before I installed contribution whenever I send email (contact us, or send letter from admin) I almost always got something like 'can't open page'.

 

Unfortunately I had some troubles with other contributions, so I reinstalled store. I remember that when e-mail was working port was 25, linefeeds LF, smtp. After I reinstalled store e-mail stoped working.

 

Thanks for any help.

Computers777dotcom

Link to comment
Share on other sites

The probably won't make any difference, the the EHLO / HELO string should be your domain name (e.g., mydomain.com ).

 

What type of freehostia account do you have? From what I read, the free accounts do not support SMTP.

 

Please post the text of the fsockopen() error message. Is it really "enable to connect..."?

 

The Outlook Express email setting should be a good place to start...that a $3 will get you a latte...

 

Ben

Link to comment
Share on other sites

The probably won't make any difference, the the EHLO / HELO string should be your domain name (e.g., mydomain.com ).

 

What type of freehostia account do you have? From what I read, the free accounts do not support SMTP.

 

Please post the text of the fsockopen() error message. Is it really "enable to connect..."?

 

The Outlook Express email setting should be a good place to start...that a $3 will get you a latte...

 

Ben

 

Thanks for reply, Ben.

It's not a free account.

The msg I got:

Warning: fsockopen(): unable to connect to mbox.freehostia.com:25 in /home/www/computers777.com/includes/classes/class.smtp.php on line 102

 

And of course a second warning msg because of a first error.

 

Thanks for help.

 

P.S. I checkd and found on host info: SMTP port 25

POP3 port 110

SMTP ON

Computers777dotcom

Link to comment
Share on other sites

Thanks for reply, Ben.

It's not a free account.

The msg I got:

Warning: fsockopen(): unable to connect to mbox.freehostia.com:25 in /home/www/computers777.com/includes/classes/class.smtp.php on line 102

 

And of course a second warning msg because of a first error.

 

Thanks for help.

 

P.S. I checkd and found on host info: SMTP port 25

POP3 port 110

SMTP ON

Unfortunately, the error message means either "mbox.freehostia.com" is wrong or port number 25 is wrong. It is possible that freehostia uses a different port number or SMTP server name behind the firewall and only allows foreign addresses to connect to public name. If that is the case, they should be able to tell you the correct name / port number to use on your web site.

 

Ben

Link to comment
Share on other sites

Look in admin -> tools -> server info

 

Is there anything listed in the PHP Core section for the variables "disable_classes" and "disable_functions"?

 

Ben

Link to comment
Share on other sites

Unfortunately, the error message means either "mbox.freehostia.com" is wrong or port number 25 is wrong. It is possible that freehostia uses a different port number or SMTP server name behind the firewall and only allows foreign addresses to connect to public name. If that is the case, they should be able to tell you the correct name / port number to use on your web site.

 

Ben

 

I checked that many times. :(

I din't even type: copied and paste just in case.

 

P.S.

I didn't find anything suspecious or disabled actually.

The thing is that email works fine with my prev. installation.

 

I think reg file for outlook will be helpfull:

 

REGEDIT4

 

[HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\[email protected]]

"DCEmail"=dword:00000002

"POP3 Server"="mbox.freehostia.com"

"POP3 Port"=dword:0000006e

"SMTP Server"="mbox.freehostia.com"

"SMTP Port"=dword:00000019

"Connection Type"=dword:00000001

"POP3 User Name"="[email protected]"

"SMTP Display Name"="[email protected]"

"SMTP Email Address"="[email protected]"

"SMTP Reply To Email Address"="[email protected]"

"SMTP Organization Name"=""

"Account Name"="[email protected]"

"POP3 Timeout"=dword:0000003c

"SMTP Timeout"=dword:0000003c

"POP3 Secure Connection"=dword:00000000

"Leave Mail On Server"=dword:00000000

"POP3 Skip Account"=dword:00000000

"POP3 Prompt for Password"=dword:00000000

"SMTP User Name"="[email protected]"

"SMTP Use Sicily"=dword:00000002

"SMTP Secure Connection"=dword:00000000

"SMTP Split Messages"=dword:00000000

"SMTP Prompt for Password"=dword:00000000

 

[HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\OMI Account Manager\Accounts\[email protected]]

"DCEmail"=dword:00000002

"POP3 Server"="mbox.freehostia.com"

"POP3 Port"=dword:0000006e

"SMTP Server"="mbox.freehostia.com"

"SMTP Port"=dword:00000019

"Connection Type"=dword:00000001

"POP3 User Name"="[email protected]"

"SMTP Display Name"="[email protected]"

"SMTP Email Address"="[email protected]"

"SMTP Reply To Email Address"="[email protected]"

"SMTP Organization Name"=""

"Account Name"="[email protected]"

"POP3 Timeout"=dword:0000003c

"SMTP Timeout"=dword:0000003c

"POP3 Secure Connection"=dword:00000000

"Leave Mail On Server"=dword:00000000

"POP3 Skip Account"=dword:00000000

"POP3 Prompt for Password"=dword:00000000

"SMTP User Name"="[email protected]"

"SMTP Use Sicily"=dword:00000002

"SMTP Secure Connection"=dword:00000000

"SMTP Split Messages"=dword:00000000

"SMTP Prompt for Password"=dword:00000000

 

Thanks for any help

Computers777dotcom

Link to comment
Share on other sites

Look in admin -> tools -> server info

 

Is there anything listed in the PHP Core section for the variables "disable_classes" and "disable_functions"?

 

Ben

 

Sorry, I was tried to check that info on a host side and of course didn't find any.

 

In admin/tools/server info both these vartiables have "no value".

 

Thanks

Computers777dotcom

Link to comment
Share on other sites

I enabled debug mode and this is what I got:

 

Warning: fsockopen(): unable to connect to mbox.freehostia.com:25 in /home/www/computers777.com/includes/classes/class.smtp.php on line 102

array(1) { [0]=> string(46) "Failed to connect to server: Permission denied" } string(52) "

 

SMTP debug enabled in class.smtp.php

 

" array(2) { [0]=> string(46) "Failed to connect to server: Permission denied" [1]=> string(14) "Not connected!" } string(52) "

 

SMTP debug enabled in class.smtp.php

 

Looks like access denied for some reason.

Any ideas?

Computers777dotcom

Link to comment
Share on other sites

bpopelar,

I asked help from my host, and this is what he recommended to me, but I don't know if it possible to do:

 

 

Hello,

 

Thank you for contacting our Technical Support Department.

 

Well, i can suggest a more easier way to use mail() function in php, because it won't open a connection but use integrated mail services. Please try to use the following script:

 

<?php

$from = 'From: YourName <[email protected]>';

$to = '[email protected]';

$subject = 'Subject';

$body = 'TEST';

 

if (mail ($to, $subject, $body, $from)) {

echo 'MAIL - OK'; } else {

echo 'MAIL FAILED';

}

?>

 

Best Regards,

James

 

What do you think?

Computers777dotcom

Link to comment
Share on other sites

Update:

I installed beta release of osCommerce 3.0 into separate folder inside existing domain to try it.

I tried to send e-mail from 'Contact Us' and Account creation confirmation and it worked fine.

 

But it doesn't work from my RC2 release.

I'm just stock. Can't do anything else. Probably I should completely reinstall whole store again, thanks, it's not a live store yet. Somehow everytime I got error of connecting to mail server. Bummer.

 

Probably it's possible to use the fact it is working with release 3 to find cause of problem with release RC2?

Any ideas?

Computers777dotcom

Link to comment
Share on other sites

bpopelar,

I asked help from my host, and this is what he recommended to me, but I don't know if it possible to do:

Hello,

 

Thank you for contacting our Technical Support Department.

 

Well, i can suggest a more easier way to use mail() function in php, because it won't open a connection but use integrated mail services. Please try to use the following script:

 

<?php

$from = 'From: YourName <[email protected]>';

$to = '[email protected]';

$subject = 'Subject';

$body = 'TEST';

 

if (mail ($to, $subject, $body, $from)) {

echo 'MAIL - OK'; } else {

echo 'MAIL FAILED';

}

?>

 

Best Regards,

James

 

What do you think?

Michael,

 

Their suggestion to use the PHP mail function is exactly what the baseline code does. This contribution is only needed if you need SMTP Password Authentication (which the PHP mail() function does not support). Somewhere along the line I thought we determined you needed authentication....

 

You should be able to back out this contribution and use the baseline code to exchange mail with the email servers.

 

There is a contribution you can use to check the basic email functionality. Load this and follow the instruction.

 

Ben

Link to comment
Share on other sites

Update:

I installed beta release of osCommerce 3.0 into separate folder inside existing domain to try it.

I tried to send e-mail from 'Contact Us' and Account creation confirmation and it worked fine.

 

But it doesn't work from my RC2 release.

I'm just stock. Can't do anything else. Probably I should completely reinstall whole store again, thanks, it's not a live store yet. Somehow everytime I got error of connecting to mail server. Bummer.

 

Probably it's possible to use the fact it is working with release 3 to find cause of problem with release RC2?

Any ideas?

You shouldn't need to reinstall the RC2 store; we should be able to figure out what is wrong and fix it.

 

Try the email test first and lets see what it tells us.

 

Ben

Link to comment
Share on other sites

Ok, that's what I got:

 

Warning: fsockopen(): unable to connect to mbox.freehostia.com:25 in /home/www/computers777.com/includes/classes/class.smtp.php on line 102

E-Mails Sent!

 

For me it looks like one method was unsuccessful and other one was successful (I don't know which one).

 

What is the next step?

In release 3 I tried to send both ways (senmail and smtp) and both worked if it is important to know.

Thanks so much for your help!

Computers777dotcom

Link to comment
Share on other sites

Ok, that's what I got:

 

Warning: fsockopen(): unable to connect to mbox.freehostia.com:25 in /home/www/computers777.com/includes/classes/class.smtp.php on line 102

E-Mails Sent!

 

For me it looks like one method was unsuccessful and other one was successful (I don't know which one).

 

What is the next step?

In release 3 I tried to send both ways (senmail and smtp) and both worked if it is important to know.

Thanks so much for your help!

Did you receive the one email?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...