ERPNEXT Email Configuration / Not Working

I am struggling to be able to see the reason why my emails on the new setup are not going out. The documentation doesn’t seem to explain how to debug / test email settings.

  1. Email Domain: I have set the the IMAP and SMTP server details correctly. But how to test this?
  2. Email Account: I believe have set up the Email Account correctly
    Ticked, ‘Enable Incoming’, ‘Default Incoming’, ‘Enable Outgoing’, ‘Default Outgoing’
    (in Outlook identical settings work fine)

I assume this means that ERPNEXT should use this account for sending and receiving?

I updated the EPRNext to V.13.32.0 and Frappe to v.13.31.0.

The error message that I get in the ERPNext Error log

Email1

So it seems to complain about ‘Invalid Outgoing Mail Server or Port’?

I have deleted already once the Email Domain and Email Account settings. Then I have re-created them (and only one Email Account to be sure).

The way I’m testing the email is going to Purchase Order, after opening using ‘Email’ option. Is this a correct way to test?

Does the user that has been logged in impact on email sending? (I assume not as I have set up Defaults in the Email Account)

So not sure what could I check or do? Thank you so much for your help!

Hi,

Was the email with those settings working before the update, or are you trying to add a new email account?

The email settings were not working before the upgrade. Going through the forum someone suggested Bench Update - did not work. So did bench update --reset that seems to update the ERPnext. However, the same problem with the email prevails, and not sure how to debug!

just for development and email debugging try GitHub - mailhog/MailHog: Web and API based SMTP testing

it starts a service on port 1025 that can catch all emails sent using the port.

there is ui for debugging sent mails on port 8025

On the ERPnext when it says - ‘Invalid Outgoing Mail Server or Port’ where is actually this setting? Is this the setting in the ‘Email Domain’?

OK - recreated the email accounts and the domain.

When setting the outgoing email it says Incorrect Server / Port, but there are no settings for this in the email account.

If I go to domain setup, I have the correct settings for the SMTP server. I would assume the email uses these settings for the sending.

Is there some other location where I should set the Server/Port?

OK - lets try gmail. Now it complains Invalid Credentials. Any ideas on the hostinger or gmail?

Email6

Could it be that Google cannot be used from 30 May 2022 ?
Anyone out there that can still us Gmail?
(not that planning to use it but trying to get company domain email working).

1 Like

Yes it can be used.

Just enable create a password to access your new app:

Gmail; I have setup 2-step verification.

When creating Email account:

If I tick only ‘Enable Incoming’ and then click ‘Save’, the system seems to connect to Gmail and accept the connection (and the App verification code from 2-step authentication)

But once I tick ‘Enable Outgoing’ it complains about the outgoing server or port. My outgoing port is 465. (Other ERPNEXT support post says the port should be 587 for Gmail, but if I tick this the system complains on the version of SSL).

Now have progress with using Gmail. Not fully working but getting to Email queue and using the Manual send it sends the email using Gmail.

Steps that I have done.

  1. You need to set the 2-step authentication in Google Account Security as described above by @xdlumertz . You will need the set up the AppKey, and use this as the password when creating Email Account
  2. Setup Email Domain to the Gmail using settings from the below image
  3. On the Email Account setup use instead of Gmail password, the App-Key from Google Account Security

Yes, got the Hostinger email working and sending emails. The same pattern applied as for the Gmail account. Although e.g. Outlook and Hostinger settings tell to use port 465 for the SMTP and set TLS/SSL, this does not work.

But by changing the port to 587 and not ticking SSL it works ! So perhaps this can be applied to other Email service providers too.

image_2022-06-04_130259404

Good day, and thanks for sharing your info.

I tried everything on configuring Gmail as host provider.
My linode server is not blacklisted, and got 2 step verification on Gmail with the Oauth verified.

But I cannot pass the Email Domain screen. While verifiyng for smtp it always says Request Timed Out.

I did the exact same as you. Can you please help?
error is: Request Timed Out

Hi @Fillipe_Feitosa,

I think, please try to add pop.gmail.com in Email Server.
Remove the Use IMAP and set 995 Port.

Save it.
Then reload it and configure the email account.

Thank You!

Hey friend, thanks for the reply. I tried to change to pop and 995 as you suggested, but no success. I really think the problem is with the SMTP outgoing emails service.

Any help?

@Fillipe_Feitosa Your incoming is fine, I prefer IMAP over POP
For your outgoing settings, Google uses two different ports for TLS/SSL see below:

Outgoing Mail (SMTP) Server
smtp.gmail.com
Requires SSL: Yes
Requires TLS: Yes (if available)
Requires Authentication: Yes
Port for SSL: 465
Port for TLS/STARTTLS: 587

Just disable TLS from your SMTP settings and enable SSL for Outgoing
Specify the port as 465
and everything should work fine

1 Like

Thanks for your response.

I can confirm that this configuration works. But I also had to ask for linode support for smtp clearance.

This is solved :slight_smile:

I just find out how to solved. you just need to untick this two in default email account setup

  • Awaiting password
  • Use ASCII encoding for password


I have tried this setup for out going but it gives me timed out