Sorry for posting yet another email related topic here, I know that there are tons of topics opened for this kind of question but after read through many of those and days of Google I still can’t solve my issue. Thanks in advance for helping.
My problem is: after setting my email account, I am able to received email in ERPNext, but the email I sent from ERPNext is not received in my client side. Which mean I send a document from ERPNext, it shows “sent” in Email Queue, I also got the email in my outlook app said it was sent (maybe because the “Append Emails to Sent Folder” option), but the receiver is not receiving the email.
I also tried to send the email using the outlook app, it is working so I assume not Microsoft side problem
I checked the connection from my ERPNext server to the outlook email server following this link. Successful until the EHLO command step, but the MAIL FROM command step it return “STARTTLS is required to send mail” error, not sure is it the problem.
I also tried another configuration which create a Email Domain first, then assign this Email Domain to the Email Account, but it is not working as well.
I’ve spent the past 5 days getting my head around the various permutations regarding email. Not an easy task as the documentation is practically useless.
I’ve had a similar error and resolved it by deselecting TLS and selecting SSL. However, doing this means you also have to change the port, usually to 465, not the conventional 587. Check with your mailbox hosting service provider to confirm the port they use.
As I checked the outlook mail server does not provide a SSL SMTP options but I try to changes it anyway, it prompt “Invalid Outgoing mail Server or Port” error and the UI freeze.
then I thought maybe “STARTTLS” and “TLS” are different, so I tried to untick the “Use TLS” options, same error prompted. Then I changed the port to 25 which is non TLS version for SMTP, same error occurred.
I do not have access to the mail server because I am using Outlook services (or I misunderstood you, correct me if I am wrong)
Previously we have another project having the same issues unable to send email (not with ERPNext though) and turns out it is because Outlook quarantine all our outgoing mail. So we thought this might be the same issue, but after we checked, no quarantined mail on Outlook side.
Currently I am still checking Google see if is it cause by generic SMTP configuration issues (not cause by ERPNext). Do let me know if you have any other suggestions. Thanks.
Have you tried deselecting both TLS and SSL and then try either port 587 or 25 or 2525.
I also recall reading somewhere that selecting both TLS and SSL might work, but cannot remember the port, probably 465.
Also ensure that on the Email Account configuration the Disable SMTP server authentication is deselected (ie Authentication:yes)
I’m also not sure whether smtp-mail.outlook.com and smtp.office365.com point to the same server, ie IP. If not then they might have different configurations.
(Updates)
I asked my admin to check the Email Server Log in the Microsoft admin exchange center, and discovered that all the mail that I sent from ERPNext are sent to the sender.
and I did received email in the sender inbox every time I send email from the ERPNext, (I thought it was because of the “Append Emails to Sent Folder” options) but at the “To:” field of the email it is correctly written the receiver email. I tried different receiver emails, same issue occurs so it is not the receiver side problem.
So maybe is something in the ERPNext did not configure correctly?
Sendgrid, it prompted "imaplib.IMAP4.error: b’LOGIN failed.’ error
Gmail, same as Error 2 produced above (I already make sure the “allow less secure apps” is on)
so is it possible that something went wrong during installation so that all outgoing email account not working?
I manually define each Email Domain, even for GMail, Yahoo, etc, in addition to my own-domain email accounts, and do not rely on the predefined services in the drop-down selection box. I’m not too sure where the email configuration detail is stored, in a file or in the DB, but to confirm my configuration has taken affect, I download an import template to view the detail.
I know phpMyAdmin has a feature to constantly check which tables have changed.
DBeaver can do a search for a specific value across all tables
Also use the browser’s DevTools > Network > Headers > Form Data to indicate which API methods are being called when the changes are made in the WUI.
Other than that, I’m fed up with the poor SMTP implementation. It’s not a new complaint and the forum is filled to the brim with people having had problems with it way back many years.
Thanks for continuously helping, I tried to install a clean frappe without ERPNext again and tested it, it is able to send email successfully. So further prove that is something wrong with the configuration of the instance currently we are working on, we are currently try to debug that.