Post by imashiine » Thu Nov 18, 2021 4:45 am

Hi, Can someone please assist me with this issue, Im running OC 3.0.3.6 and i'm using SMTP to send newsletters to my customers, (everything is setup fine and working) but everytime im sending the messages to say 250 customer emails eveyrtime it stops on the number 70, and i get the error
"PHP Fatal error: Uncaught Exception: Error: Password not accepted from server!", I'm using google workspace, with a paid subscirption, and my limit for sending is 5000 a day which im no where close to, if this problem has been solved before please point me to the right post and help, thank you.

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by thekrotek » Thu Nov 18, 2021 5:00 am

Error message says for itself.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by imashiine » Thu Nov 18, 2021 5:07 am

thekrotek wrote:
Thu Nov 18, 2021 5:00 am
Error message says for itself.
So how is it sending exactly 70 messages, and then stopping and not accepting the username and password?

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by thekrotek » Thu Nov 18, 2021 5:14 am

Not related to OpenCart at all. Contact your hosting provider.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by ADD Creative » Thu Nov 18, 2021 5:17 am

You probably need to log $reply or add it on to the end or the error message in the location linked below. This may give you a clue as to why it stops.
https://github.com/opencart/opencart/bl ... #L204-L206

www.add-creative.co.uk


Expert Member

Posts

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

Post by imashiine » Thu Nov 18, 2021 5:26 am

ADD Creative wrote:
Thu Nov 18, 2021 5:17 am
You probably need to log $reply or add it on to the end or the error message in the location linked below. This may give you a clue as to why it stops.
https://github.com/opencart/opencart/bl ... #L204-L206
hi, thank you for replying, i just checked the file on the post you sent, and the codes are exactly the same as the one on my server, if thats what you ment, if not please elaborate im no expert on these things. thank you for your time and helping me.

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by thekrotek » Thu Nov 18, 2021 5:30 am

imashiine wrote:
Thu Nov 18, 2021 5:26 am
ADD Creative wrote:
Thu Nov 18, 2021 5:17 am
You probably need to log $reply or add it on to the end or the error message in the location linked below. This may give you a clue as to why it stops.
https://github.com/opencart/opencart/bl ... #L204-L206
hi, thank you for replying, i just checked the file on the post you sent, and the codes are exactly the same as the one on my server, if thats what you ment, if not please elaborate im no expert on these things. thank you for your time and helping me.
thekrotek wrote:
Thu Nov 18, 2021 5:14 am
Not related to OpenCart at all. Contact your hosting provider.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by ADD Creative » Thu Nov 18, 2021 5:42 am

imashiine wrote:
Thu Nov 18, 2021 5:26 am
hi, thank you for replying, i just checked the file on the post you sent, and the codes are exactly the same as the one on my server, if thats what you ment, if not please elaborate im no expert on these things. thank you for your time and helping me.
No, you would need to modify that code to log or display the real $reply. For example you could temporarily change.

Code: Select all

throw new \Exception('Error: Password not accepted from server!');
To

Code: Select all

throw new \Exception('Error: Password not accepted from server! ' . $reply);

www.add-creative.co.uk


Expert Member

Posts

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

Post by imashiine » Thu Nov 18, 2021 6:31 am

ADD Creative wrote:
Thu Nov 18, 2021 5:42 am
imashiine wrote:
Thu Nov 18, 2021 5:26 am
hi, thank you for replying, i just checked the file on the post you sent, and the codes are exactly the same as the one on my server, if thats what you ment, if not please elaborate im no expert on these things. thank you for your time and helping me.
No, you would need to modify that code to log or display the real $reply. For example you could temporarily change.

Code: Select all

throw new \Exception('Error: Password not accepted from server!');
To

Code: Select all

throw new \Exception('Error: Password not accepted from server! ' . $reply);
just made the change and sent an email to some customers about a sale, and now the number bumped up to 90 from 70 successfull messages sent, and now i got this error in my logs
"PHP Fatal error: Uncaught Exception: Error: DATA not accepted from server!"

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by by mona » Thu Nov 18, 2021 6:38 am

imashiine wrote:
Thu Nov 18, 2021 4:45 am
if this problem has been solved before please point me to the right post and help, thank you.
https://www.google.com/search?q=PHP+Fat ... MQQ4dUDCA0

https://www.google.com/search?client=sa ... 8&oe=UTF-8

When you find the solution, please update your post and mark it as [SOLVED] in the title to help others searching for the same - thank you

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ADD Creative » Thu Nov 18, 2021 7:43 am

imashiine wrote:
Thu Nov 18, 2021 6:31 am
just made the change and sent an email to some customers about a sale, and now the number bumped up to 90 from 70 successfull messages sent, and now i got this error in my logs
"PHP Fatal error: Uncaught Exception: Error: DATA not accepted from server!"
What do you have the SMTP Timeout set to in the OpenCart Mail settings and have you tried increasing it?

www.add-creative.co.uk


Expert Member

Posts

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

Post by imashiine » Sat Nov 20, 2021 4:39 am

ADD Creative wrote:
Thu Nov 18, 2021 7:43 am
imashiine wrote:
Thu Nov 18, 2021 6:31 am
just made the change and sent an email to some customers about a sale, and now the number bumped up to 90 from 70 successfull messages sent, and now i got this error in my logs
"PHP Fatal error: Uncaught Exception: Error: DATA not accepted from server!"
What do you have the SMTP Timeout set to in the OpenCart Mail settings and have you tried increasing it?
it was set to 20

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by imashiine » Sat Nov 20, 2021 4:44 am

UPDATE: after I used the change to add the $reply to the error message It showed this
454 4.7.0 Too many login attempts, please try again later. v25sm865200pfg.175 - gsmtp
so i did some googling and apparently, every time in the Open cart mail section it sends out the an email, it logs into my Gmail account via smtp, to send the message and then logs out, and it does this for however many addresses i have to send my newsletter to.

so i found a few google posts that said i need to pool the smtp connection to logout after it sends all the messages in the que, and now that seems to be the only things i believe to fix it but I'm using cpanel and whm and idk where i would go to add a code or script to fix that issue, if anyone knows or have any idea, much appreciated.

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by ADD Creative » Sat Nov 20, 2021 8:32 am

You would have to rewrite the OpenCart mail class and probably the newsletter sending function as well.

www.add-creative.co.uk


Expert Member

Posts

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

Post by by mona » Mon Nov 22, 2021 2:07 am

The error message is about login attempts which means too many have FAILED.
So better check your credentials and have "less secure apps" enabled on your gmail account.

As ADD Creative explains above : smtp persistent connections, i.e. bulk mail connection sharing, is not possible with default OC. OC creates a new smtp connection for every mail (also the marketing stuff), you would need to totally redesign the smtp class or deploy a new class like PHPMailer which has that build in but then you would have to rewrite many parts of OC where mails are send.

You could also opt for some external bulk mail api services.

In addition, many mail servers close the smtp connection themselves (spam measure) so even if you change the OC code to use persistent smtp connections, it might not even work.

My advise, fix your failed login attempts first.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by imashiine » Thu Dec 02, 2021 5:32 am

by mona wrote:
Mon Nov 22, 2021 2:07 am
The error message is about login attempts which means too many have FAILED.
So better check your credentials and have "less secure apps" enabled on your gmail account.

As ADD Creative explains above : smtp persistent connections, i.e. bulk mail connection sharing, is not possible with default OC. OC creates a new smtp connection for every mail (also the marketing stuff), you would need to totally redesign the smtp class or deploy a new class like PHPMailer which has that build in but then you would have to rewrite many parts of OC where mails are send.

You could also opt for some external bulk mail api services.

In addition, many mail servers close the smtp connection themselves (spam measure) so even if you change the OC code to use persistent smtp connections, it might not even work.

My advise, fix your failed login attempts first.
Hello, thank you for this informative post, ive made sure less secure apps is on, the login creditionals are correct because its sending around 60-90 emails messages, it just stops after that, and then i get the error mentioned above, i've searched the internet and it seems, that after a few logins Google (Gmail) is preventing all the messages from being sent seeing as opencart logs into the email account, sends the message and logs out for every message that is sent. I used to use the "Mail" function instead of SMTP, but the emails had the gmail warning: "This message may not have been sent by the original address" do you think using Mailchimp extension would help with this issue? and if so would it still send from my gmail account or using Mail function?

New member

Posts

Joined
Mon Jul 14, 2014 11:36 pm

Post by by mona » Fri Dec 03, 2021 7:53 am

Might very well that you are hitting this:
Denial of Service (DoS) limits
Google Workspace SMTP relay servers have protections in place to guard against Denial of Service (DoS) attacks. To avoid conflicts with these protections, SMTP agents that send large amounts of mail through smtp-relay.google.com and smtp.gmail.com should reuse connections, sending multiple messages per connection. This is also known as connection caching. For instructions on this process, please contact your email server software provider.

Be sure that your server presents unique identifiers in the HELO or EHLO arguments during the SMTP connection. For example, choose your domain name or the name of your server rather than "localhost" or "smtp-relay.gmail.com."
in other words, it might be that you are sending too many emails per time-frame without proper message id and are therefore triggering the ddos measures which prevent you from signing in which after a number of attempts would generate that message.
The OC marketing contact emails do not have throttling and OC smtp emails generally have no unique message id.


When using PHP Mail aka OC "mail", your host handles the mail sending, all OC does is compose the email and set the from email address in the php ini configuration.
Perhaps your host adds a unique message id to the mails and also throttles the sending.

The "This message may not have been sent by the original address" comes from the fact that the "from email address" is not the same as the email address you use to sign in to gmail, perhaps use the -f parameter which is used by PHP mail.

in general, better not use OC marketing contact to launch bulk email distribution.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by straightlight » Fri Dec 03, 2021 8:24 am

Another possible way to achieve this would be by using the PHPMailer extension from the Marketplace rather the need to re-write the SMTP class. By using the SMTP settings, see if the issue can be reproduced.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: ravikumar22, Semrush [Bot] and 83 guests