Outgoing mail not working

Hi there,

I try to set up my outgoing emails on ERPNext. I was able to check the SMTP connection from the server with telnet. So sending emails should be possible.

After this I set up the outgoing email server credentials and checkted “Default Server”.

When I go e.g. to an Opportunity and click on new mail, I’m able to create a new mail and click on send. But I never receive this mail…

I have one message in the worker.error.log:

19:11:55 default: frappe.utils.background_jobs.execute_job(async=True, event=u'sendmail', job_name=u'<function sendmail at 0x7fc5977a0b90>', kwargs={'lang': u'de', 'attachments': u'[]', 'recipients': [u'myemail@myserver.com'], 'cc': [], 'print_format': u'', 'session': {u'data': {u'session_expiry': u'06:00:00', u'session_country': 'DE', 'csrf_token': '60aa8341d27f8ed1d9e5b906974fe0b087d24c376958f73a1fc177c0', u'last_updated': '2016-12-01 19:11:47.339913', u'lang': u'de', u'user_type': u'System User', 'user': u'myemail@myserver.com', u'full_name': u'Guest', u'device': u'desktop', 'session_ip': u'123.123.123.123'}, u'user': u'myemail@myserver.com', u'sid': u'f55fcb058820df02dbf2dbd21d6489d3f1d69f8248e77944a2ba5bae'}, 'communication_name': '3d9a1844f2', 'print_html': u''}, method=<function sendmail at 0x7fc5977a0b90>, site=u'mysite.myserver.com', user=u'myemail@myserver.com') (9706f63c-9ee7-4064-a1a0-986d4aa652b4) 19:11:56 default: Job OK (9706f63c-9ee7-4064-a1a0-986d4aa652b4) 19:11:56 Result is kept for 500 seconds

This looks not like an error, right?

If I go to the communication log (https://mysite.myserver.com//desk#List/Communication) I see a status “sent”. But on the email log of the document I see status “sending”

bench doctor says:
----Checking scheduler status----- Workers online: 3 -----None Jobs-----

And I already did a bench --site mysite.myserver.com enable-scheduler

And a supervisorctrl status says:

frappe-bench-redis:frappe-bench-redis-cache RUNNING pid 13250, uptime 0:50:21 frappe-bench-redis:frappe-bench-redis-queue RUNNING pid 13249, uptime 0:50:21 frappe-bench-redis:frappe-bench-redis-socketio RUNNING pid 13251, uptime 0:50:21 frappe-bench-web:frappe-bench-frappe-web RUNNING pid 13859, uptime 0:24:20 frappe-bench-web:frappe-bench-node-socketio RUNNING pid 13868, uptime 0:24:19 frappe-bench-workers:frappe-bench-frappe-default-worker-0 RUNNING pid 13828, uptime 0:24:26 frappe-bench-workers:frappe-bench-frappe-long-worker-0 RUNNING pid 13837, uptime 0:24:25 frappe-bench-workers:frappe-bench-frappe-schedule RUNNING pid 13827, uptime 0:24:26 frappe-bench-workers:frappe-bench-frappe-short-worker-0 RUNNING pid 13842, uptime 0:24:24

Do you have any suggestions how to fix the mail sending issue?

Thanx in advance,
–paul

Which SMTP server are you using ? . Please post your outgoing email configuration

Here are my settings:

In Notifications I have the following settings:

About the email-configuration:
I have a Google for Work account. It is configured with 2-factor-authentication which prevents sending via smtp. Therefore I activated “less secure apps” and set up an app-password and activated the SMTP relay from Gmail.

If I send an email with this credentials from the server via openssl / telnet (http://stackoverflow.com/a/11049483) I receive the mail.

@paulator Please try this config:

TLS/SSL required: yes
SMTP server address: smtp.gmail.com
SMTP username: username@gmail.com
SMTP password: your_password
SMTP port (TLS): 587
SMTP port (SSL): 465

Hi @srajelli

This works. Thank you for your suggestion.

Is there a way to use the Google relay server? If not, I’ll setup a local postfix server which uses the relay server.

All the best
–paul

@paulator Do you want to store the sent emails in your gmail as well ? or is there something else you want to achieve ?

Hi @srajelli,

yes, this is exactly the case and additionally, there is a extended number of mails which can be sent daily (10.000 instead of 2.000).

Please refer to this site: https://support.google.com/a/answer/176600

@paulator SMTP relay service is only for registered G-suite users , If you are a G suite user you will need to login to Google admin console and set your erpnext instance’s ip address in there so that it can authenticate you and remove the the limit.

Hi,

I’m a registered G-suite user. I’ll give it a try and come back here if there are further questions.

Thank you for your support.