Page 1 of 1

smtp not working 4.0.2.2

Posted: Fri Aug 11, 2023 1:38 am
by Hourglasss
Im using same exact mail fields as my working 3.0.3.8
but it doesnt seem to work

Code: Select all

2023-08-10 17:45:46 - PHP Warning:  fsockopen(): Unable to connect to xxxx (Network is unreachable) in /var/www/html/opencart/system/library/mail/smtp.php on line 133
2023-08-10 17:45:46 - Exception:  Error: Network is unreachable (101) in /var/www/html/opencart/system/library/mail/smtp.php on line 259

Re: smtp not working 4.0.2.2

Posted: Fri Aug 11, 2023 2:03 am
by straightlight
Hourglasss wrote:
Fri Aug 11, 2023 1:38 am
Im using same exact mail fields as my working 3.0.3.8
but it doesnt seem to work

Code: Select all

2023-08-10 17:45:46 - PHP Warning:  fsockopen(): Unable to connect to xxxx (Network is unreachable) in /var/www/html/opencart/system/library/mail/smtp.php on line 133
2023-08-10 17:45:46 - Exception:  Error: Network is unreachable (101) in /var/www/html/opencart/system/library/mail/smtp.php on line 259
Is the OC v4.0.2.2 also installed on the same domain and the same server? You just need to compare both email settings from your OC admin > systems > settings > edit settings > mail tab.

Re: smtp not working 4.0.2.2

Posted: Fri Aug 11, 2023 7:25 pm
by Hourglasss
straightlight wrote:
Fri Aug 11, 2023 2:03 am
Hourglasss wrote:
Fri Aug 11, 2023 1:38 am
Im using same exact mail fields as my working 3.0.3.8
but it doesnt seem to work

Code: Select all

2023-08-10 17:45:46 - PHP Warning:  fsockopen(): Unable to connect to xxxx (Network is unreachable) in /var/www/html/opencart/system/library/mail/smtp.php on line 133
2023-08-10 17:45:46 - Exception:  Error: Network is unreachable (101) in /var/www/html/opencart/system/library/mail/smtp.php on line 259
Is the OC v4.0.2.2 also installed on the same domain and the same server? You just need to compare both email settings from your OC admin > systems > settings > edit settings > mail tab.
yea its on the same server thats what i litterly did i copied over the same exact smtp settings from 3.0.3.8 where smtp works and i can send and receive emails,

Re: smtp not working 4.0.2.2

Posted: Fri Aug 11, 2023 8:36 pm
by JNeuhoff
Do you have a cPanel? If so, you can lookup there the exact email settings for your SMTP and then configure your OpenCart admin backend at
System > Settings > edit Store > tab Mail

Re: smtp not working 4.0.2.2

Posted: Fri Aug 11, 2023 10:34 pm
by straightlight
Hourglasss wrote:
Fri Aug 11, 2023 7:25 pm
straightlight wrote:
Fri Aug 11, 2023 2:03 am
Hourglasss wrote:
Fri Aug 11, 2023 1:38 am
Im using same exact mail fields as my working 3.0.3.8
but it doesnt seem to work

Code: Select all

2023-08-10 17:45:46 - PHP Warning:  fsockopen(): Unable to connect to xxxx (Network is unreachable) in /var/www/html/opencart/system/library/mail/smtp.php on line 133
2023-08-10 17:45:46 - Exception:  Error: Network is unreachable (101) in /var/www/html/opencart/system/library/mail/smtp.php on line 259
Is the OC v4.0.2.2 also installed on the same domain and the same server? You just need to compare both email settings from your OC admin > systems > settings > edit settings > mail tab.
yea its on the same server thats what i litterly did i copied over the same exact smtp settings from 3.0.3.8 where smtp works and i can send and receive emails,
Please submit a screenshot of your host panel's email settings and your OC mail tab's email settings, both, without passwords.

Re: smtp not working 4.0.2.2

Posted: Sat Aug 12, 2023 8:58 pm
by Hourglasss
straightlight wrote:
Fri Aug 11, 2023 10:34 pm
Hourglasss wrote:
Fri Aug 11, 2023 7:25 pm
straightlight wrote:
Fri Aug 11, 2023 2:03 am


Is the OC v4.0.2.2 also installed on the same domain and the same server? You just need to compare both email settings from your OC admin > systems > settings > edit settings > mail tab.
yea its on the same server thats what i litterly did i copied over the same exact smtp settings from 3.0.3.8 where smtp works and i can send and receive emails,
Please submit a screenshot of your host panel's email settings and your OC mail tab's email settings, both, without passwords.
JNeuhoff wrote:
Fri Aug 11, 2023 8:36 pm
Do you have a cPanel? If so, you can lookup there the exact email settings for your SMTP and then configure your OpenCart admin backend at
System > Settings > edit Store > tab Mail
Image


im self hosting and using 3rd party for mail hosting,

im also using cloudflare but i configured cloudflare to forward and set ti up correctlly,
Cause it works with 3.0.3.8

Re: smtp not working 4.0.2.2

Posted: Sat Aug 12, 2023 9:09 pm
by Hourglasss
Image

Re: smtp not working 4.0.2.2

Posted: Sat Aug 12, 2023 10:33 pm
by straightlight
Hourglasss wrote:
Sat Aug 12, 2023 9:09 pm
Image
The configuration between your OC emails and your email server don't match. Ensure to properly compare the results when entering the email configurations in your OC admin mail tab. If you are unable to fill this in, you can also contact your host for assistance on this.

Re: smtp not working 4.0.2.2

Posted: Tue Aug 15, 2023 9:01 pm
by Hourglasss
straightlight wrote:
Sat Aug 12, 2023 10:33 pm
Hourglasss wrote:
Sat Aug 12, 2023 9:09 pm
Image
The configuration between your OC emails and your email server don't match. Ensure to properly compare the results when entering the email configurations in your OC admin mail tab. If you are unable to fill this in, you can also contact your host for assistance on this.

when using the "correct" smpt host settings i dont get any errors and i dont receive emails when sending emails via the contact form.,
im using nginx as server is there any server configuration needed to make smtp work, i allowed port 465 to the ufw firewall to.

Re: smtp not working 4.0.2.2

Posted: Wed Aug 16, 2023 1:13 am
by ADD Creative
If you don't get any errors, you then need to check the mail server logs.

Re: smtp not working 4.0.2.2

Posted: Wed Aug 16, 2023 2:56 pm
by speakspaceAdmin
So I just spent the past few days upgrading from 3.0.3.2 to 4.0.2.2. Took me 4 days to figure out the email. DNS was the issue.

First: Opencart config
Mail
host: tls://email@domain.com
Username: your email
Password: your email password
port 587

thank make sure your DNS has:

the proper NS ALL 1 Hour (for Google Workspace it is the following)
ALT1.ASPMX.L.GOOGLE.COM
ALT2.ASPMX.L.GOOGLE.COM
ALT3.ASPMX.L.GOOGLE.COM
ALT4.ASPMX.L.GOOGLE.COM
ASPMX.L.GOOGLE.COM
smtp.google.com

Than make the A Record
localhost 127.0.0.1 30 seconds
domain.com <YOUR SERVER IP> 30 seconds
mail.YOURDOMAIN.com <YOUR SERVER IP> 30 seconds

and CNAME
webmail.<YOURDOMAINNAME>.com

Finally TXT record
YOUR DOMAIN. v=spf1 ip4:<YOUR IP4 ADDRESS> +a +mx +ip4:<YOUR IP4 ADDRESS> +include:relay.mailchannels.net +include:websitewelcome.com ~all

This should fix your email issue.

Re: smtp not working 4.0.2.2

Posted: Tue Aug 22, 2023 12:15 am
by Hourglasss
speakspaceAdmin wrote:
Wed Aug 16, 2023 2:56 pm
So I just spent the past few days upgrading from 3.0.3.2 to 4.0.2.2. Took me 4 days to figure out the email. DNS was the issue.

First: Opencart config
Mail
host: tls://email@domain.com
Username: your email
Password: your email password
port 587

thank make sure your DNS has:

the proper NS ALL 1 Hour (for Google Workspace it is the following)
ALT1.ASPMX.L.GOOGLE.COM
ALT2.ASPMX.L.GOOGLE.COM
ALT3.ASPMX.L.GOOGLE.COM
ALT4.ASPMX.L.GOOGLE.COM
ASPMX.L.GOOGLE.COM
smtp.google.com

Than make the A Record
localhost 127.0.0.1 30 seconds
domain.com <YOUR SERVER IP> 30 seconds
mail.YOURDOMAIN.com <YOUR SERVER IP> 30 seconds

and CNAME
webmail.<YOURDOMAINNAME>.com

Finally TXT record
YOUR DOMAIN. v=spf1 ip4:<YOUR IP4 ADDRESS> +a +mx +ip4:<YOUR IP4 ADDRESS> +include:relay.mailchannels.net +include:websitewelcome.com ~all

This should fix your email issue.
where you having issues with default smtp settings to?

also you add those records to your cloudflare?

Re: smtp not working 4.0.2.2

Posted: Tue Aug 29, 2023 4:09 am
by Hourglasss
anyone else got smtp working? im using the correct settings,

im pretty sure there is a bug in smtp?

when i use my smtp settings on 3.0.3.8 works correctly so my dns records are correct,

these settings wrok on 3.0.3.8 but not 4.0.2.2

Image

Re: smtp not working 4.0.2.2

Posted: Tue Aug 29, 2023 7:15 am
by ADD Creative
Are the 3.0.3.8 and 4.0.2.2 sites on the same server? What errors do you see in the PHP error logs on 4.0.2.2?

Re: smtp not working 4.0.2.2

Posted: Tue Aug 29, 2023 6:36 pm
by Hourglasss
ADD Creative wrote:
Tue Aug 29, 2023 7:15 am
Are the 3.0.3.8 and 4.0.2.2 sites on the same server? What errors do you see in the PHP error logs on 4.0.2.2?

yea they are on the same server

shouldnt the 3.0.3.8 settings work exactly the same with 4.0.2.2?

are there any other logs i could check?

Re: smtp not working 4.0.2.2

Posted: Tue Aug 29, 2023 7:50 pm
by ADD Creative
The same settings should work. Nothing much has changed in the SMTP connecting between the two versions. If you are getting "fsockopen(): Unable to connect to" errors then that suggests the settings haven't been entered correctly (maybe some whitespace or hidden characters) or a problem with the hosting.

Re: smtp not working 4.0.2.2

Posted: Wed Aug 30, 2023 1:26 am
by Hourglasss
ADD Creative wrote:
Tue Aug 29, 2023 7:50 pm
The same settings should work. Nothing much has changed in the SMTP connecting between the two versions. If you are getting "fsockopen(): Unable to connect to" errors then that suggests the settings haven't been entered correctly (maybe some whitespace or hidden characters) or a problem with the hosting.
Yea im not getting any errors at all,
can you spin up a 4.0x.x shop and try to setup SMTP? to confirm or anyone else already got it working?
the only difference between my 3.0.3.8 shop and 4.0.x.x shop is that 3.0.3.8 is running apache and my 4.0.0 is running nginx that shouldnt matter toug right>?

Re: smtp not working 4.0.2.2

Posted: Wed Aug 30, 2023 7:18 am
by ADD Creative
SMTP works fine for me. If you are not seeing any errors in the OpenCart error log or the PHP error log, then check your mail server log to see it the email reached that stage.