Post by HAO » Thu Oct 06, 2022 3:48 am

I know there are many related posts on this forum:
https://redmarlin.net//blog/post/openca ... r-tutorial

But I have no way to find the modify steps to fully comply with OpenCart 2.3.0.2, I've also made sure that my SMTP settings are working properly to send order notifications and marketing emails.

My Setup:
SMTP Host: ssl://smtp.gmail.com
SMTP Username: My domain name email (Gmail Business Email)
SMTP Password:
SMTP Port: 25
Timeout: 5

cPanel:
SMTP Host: mail.My domain name
SMTP Username: My domain name email (cPanel email)
SMTP Password:
SMTP Port: 25
Timeout: 5

and

cPanel:
SMTP Host: ssl://mail.My domain name
SMTP Username: My domain name email (cPanel email)
SMTP Password:
SMTP Port: 465
Timeout: 5

But when I want to use the mail function provided by the module, My mail is forever blocked by Gmail.

If i choose mail to send, I may be able to receive email notifications, but others may not be able to receive order notifications, This is a Google related policy.

I hope to be able to find a definite solution to this, Does anyone know how to fix it?

Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by OSWorX » Thu Oct 06, 2022 12:17 pm

HAO wrote:
Thu Oct 06, 2022 3:48 am
I know there are many related posts on this forum ..
And much more about that in this forum here - and also many answers!
Please be so nice and use the forums search (right top) - thx.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ADD Creative » Thu Oct 06, 2022 6:07 pm

To fix the contact form from address try.
https://github.com/opencart/opencart/co ... 2f7903601e

For you settings try.
SMTP Host: ssl://example.com Where example.com is the domain of the SMTP server
SMTP Port: 465
Also try increasing your SMTP Timeout. 5 seconds is very low. Some SMTP server take a lot longer than that.

For the issues with using Mail as the Mail Engine. These are probably hosting related. Try setting the Mail Parameters to "-ftest@example.com", without the quotes, where test@example.com is your email address.

You could also use an online email deliverability checker to check your email don't look like spam.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Tue Oct 11, 2022 8:16 pm

I've edited the file as you suggested, But I still get the same message.

Do I need to modify the system/library/mail.php file according to this posts?
https://redmarlin.net//blog/post/openca ... r-tutorial

If I want to make changes to 2.2.0.0 and 2.3.0.2 what should I do?

Because I have the same problem with both platforms. (Different hosts)

I can't find the code following the steps above, Can you help me?

Thank you!

P2. The way you said "-ftest@example.com" I tried, but no effect. :-\

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Tue Oct 11, 2022 9:34 pm

You do not need to make the changes to system/library/mail.php and 2.2.0.0 and 2.3.0.2 already have the changes.

You need to be clear what mail settings you are now using and the exact error log you are seeing.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Wed Oct 12, 2022 4:21 am

I know I have hidden my domain name, But I also confirmed my SMTP settings using Google Check MX is normal:
Image

I also confirmed that my SMTP settings can send order notifications normally:
Image

Sender Information in Gmail:
寄件者: My store name <service@my.domain.name>
回覆至: My store name <service@my.domain.name>
收件者: My email address
日期: 2022年10月12日 凌晨3:01
主旨: 電子郵件測試
寄件人: my.domain.name
簽署者: my.domain.name
安全性: 標準型加密 (TLS) 瞭解詳情
: 根據 Google 專屬標準判斷為重要郵件。

But the email sent through the extension is still wrong:
12-Oct-2022 0:29:59 AM - Initiated Alert for Product ID 7845
12-Oct-2022 0:30:01 AM - Email failed sending to service@my.domain.name, my.gmail@gmail.com. Issue: Error: RCPT TO not accepted from server!
12-Oct-2022 0:30:01 AM - Email sent to service@my.domain.name, my.gmail@gmail.com

What SMTP settings do I need to modify for this?

About using using Mail as the Mail Engine, I have set it up but it didn't send it successfully, At least my gmail doesn't get the email.

There is no record of sending in the Gmail business mailbox. (service@my.domain.name)

So I want to use SMTP properly for sending emails, Can you help me!

Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Wed Oct 12, 2022 5:49 am

Do the normal OpenCart email now work and it's just an extension that doesn't? If so it could be the extension. Try without any additional alert emails.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Wed Oct 12, 2022 7:12 am

The developer of the extension told me that this is related to my SMTP settings, But as you can see I am able to receive emails with OpenCart normally.

With all the extensions built in email notifications, I think it's hard to dodge the norm from Google, So that's why I want to confirm, do I need to modify system/library/mail.php?

Because in different hosts, different extensions, different stores have the same problem, The difference is that OpenCart has to use normal cPanel email:
Image

This setting is also normal.

Of course, About the send email function used by the extension, I have inquiries about possible code:

Code: Select all

		$data['hb_lowstock_to'] 				= isset($extn_info['hb_lowstock_to'])?$extn_info['hb_lowstock_to']: $this->config->get('config_email');
		$data['hb_lowstock_nostock_to'] 		= isset($extn_info['hb_lowstock_nostock_to'])?$extn_info['hb_lowstock_nostock_to']: $this->config->get('config_email');
		$data['sender_name'] 	= (isset($email_options['sender_name']))? $email_options['sender_name'] : $store_info['config_name'];
		$data['sender_email'] 	= (isset($email_options['sender_email']))? $email_options['sender_email'] : $store_info['config_email'];
		$data['email_replyto'] 	= (isset($email_options['email_replyto']))? $email_options['email_replyto'] : '';
		$data['email_bcc'] 		= (isset($email_options['email_bcc']))? $email_options['email_bcc'] : '';
Do you know where is the problem?

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Wed Oct 12, 2022 4:10 pm

If all your normal OpenCart emails work then the problem is with the extension. Looking at the log you posted, it is trying to send to two email addresses at once and your mail server is rejecting this.
12-Oct-2022 0:30:01 AM - Email failed sending to service@my.domain.name, my.gmail@gmail.com. Issue: Error: RCPT TO not accepted from server!
Maybe you are entering two addresses in its setting or the OpenCart additional alert emails. Try without any spaces. Or the extension does not split the address up into seperate emails correctly.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Wed Oct 12, 2022 5:47 pm

After a day of observation, The code you have provided already enables service@my.domain.name to receive extension notification emails.

But the situation of the other website is unknown, I will confirm this.

Thank you for your help!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: No registered users and 59 guests