Outgoing Email 'Not Sent'

After a few more checks. This is what i get.

frappe:frappe-web RUNNING pid 11114, uptime 0:03:23
frappe:frappe-worker RUNNING pid 11113, uptime 0:03:23
frappe:frappe-workerbeat RUNNING pid 11121, uptime 0:03:23
node-socketio BACKOFF Exited too quickly (process log may have details)
redis-async-broker RUNNING pid 11128, uptime 0:03:23
redis-cache RUNNING pid 11143, uptime 0:03:23

Anything in Setup / System / Scheduler Logs from the UI?

Nothing in schedule logs.

Ok that means that your outgoing email settings have some problem. Most likely it is timing out. Try saving your outgoing email settings again. Did you change them recently?

I’ve tried other accounts but i switched it back. By saving again do you mean deleting the old one and try setting outgoing email again?

Deleted the old one and created a new account for outgoing. Still ‘Not Sent’.

Tried to check again.

administrator@skserpserver:~/frappe-bench$ sudo supervisorctl status
frappe:frappe-web RUNNING pid 18637, uptime 0:06:04
frappe:frappe-worker RUNNING pid 18636, uptime 0:06:04
frappe:frappe-workerbeat RUNNING pid 18644, uptime 0:06:04
node-socketio FATAL Exited too quickly (process log may have details)
redis-async-broker RUNNING pid 12089, uptime 0:52:19
redis-cache RUNNING pid 12094, uptime 0:52:19

Scheduler logs showed this error.

{
“attachments”: “[]”,
“cc”: [],
“communication_name”: “d9a24f30fb”,
“lang”: “en”,
“print_format”: “SKS Quotation”,
“print_html”: “”,
“recipients”: [
"skskitchen@gmail.com"
],
“site”: “site1.local”
}
Traceback (innermost last):
File “/home/administrator/frappe-bench/apps/frappe/frappe/tasks.py”, line 231, in sendmail
recipients=recipients, cc=cc)
File “/home/administrator/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 162, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc)
File “/home/administrator/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 132, in _notify
bulk=True
File “/home/administrator/frappe-bench/apps/frappe/frappe/init.py”, line 352, in sendmail
send_after=send_after, expose_recipients=expose_recipients, bulk_priority=bulk_priority)
File “/home/administrator/frappe-bench/apps/frappe/frappe/email/bulk.py”, line 50, in send
email_account = get_outgoing_email_account(True, append_to=reference_doctype)
File “/home/administrator/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 56, in get_outgoing_email_account
frappe.OutgoingEmailError)
File “/home/administrator/frappe-bench/apps/frappe/frappe/init.py”, line 265, in throw
msgprint(msg, raise_exception=exc)
File “/home/administrator/frappe-bench/apps/frappe/frappe/init.py”, line 258, in msgprint
_raise_exception()
File “/home/administrator/frappe-bench/apps/frappe/frappe/init.py”, line 243, in _raise_exception
raise raise_exception, encode(msg)
OutgoingEmailError: Please setup default Email Account from Setup > Email > Email Account

Just go to the email settings form and save it again. It will check if there is any problem in connection or logging in.

Clicked the saves button. Saving watermark appears then disappears without error or issues.

Check for other email service if email pulling works.

Tried Yahoo Mail service. Same results, ‘not sent’ in bulk email.

administrator@skserpserver:~/frappe-bench$ sudo supervisorctl status
frappe:frappe-web RUNNING pid 3977, uptime 0:11:33
frappe:frappe-worker RUNNING pid 3976, uptime 0:11:33
frappe:frappe-workerbeat RUNNING pid 3984, uptime 0:11:33
node-socketio RUNNING pid 3349, uptime 0:27:59
redis-async-broker RUNNING pid 3346, uptime 0:27:59
redis-cache RUNNING pid 3351, uptime 0:27:59

Workers are running fine now. Still ‘not sent’ emails. Any other way to troubleshoot?

It could be due to one of these 4 exceptions, which all indicate that your settings are incorrect or have some problem that is encountered while sending emails.

https://github.com/frappe/frappe/blob/develop/frappe/email/bulk.py#L273

When you mentioned that you tried Yahoo, did you make sure that you aren’t adding, but modifying the existing email account with your yahoo settings for sending email?

For the Yahoo Service, I added it and set it as my default outgoing email.

Is it worth a try if i will connect the server to the internet via another service provider?

@airzoink could be. This is difficult to debug without direct access.

Is it ok if i give you access to my server?

Hi @airzoink, do you get solution for this.

@Sumit_Arora and others

I faced the same issue after migrating my local virtual machine to a remote server. The setup that i was using worked fine for the VM on my local machine, but did not work for the remote server.

I fixed this by setting the host_name Property in banch/sites/[erpnextfolder]/site_config.json to the appropriate value, since I changed this value to make the PDF generation work for outgoing mails (see PDF Email Problems Thread) on my VM.

{
 ...
 "host_name": "[http(s)://your.host.name or http(s)://your.host.ip.address]",
...
 }
}

This certainly worked in my case.

Hope this helps.

2 Likes

:+1: worked for me.