Outgoing Email 'Not Sent'

Tried to setup outgoing email based on instructions (using free Gmail Account). I could not make it to send out quotations, sales order, sales invoice, etc… I tried restarting and updating bench. Changed email account and saving it without errors. Still Bulk Email List gives out ‘not sent’ status on every email i tried to send out. Help please!

Thanks!

Check sudo supervisorctl status. Also check bench doctor for any holdup in celery queues.

Ran bench doctor. This is what i get.

Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/administrator/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/administrator/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/administrator/frappe-bench/apps/frappe/frappe/commands.py”, line 865, in doctor
return _doctor()
File “/home/administrator/frappe-bench/apps/frappe/frappe/utils/doctor.py”, line 159, in doctor
locks = get_timedout_locks()
File “/home/administrator/frappe-bench/apps/frappe/frappe/utils/doctor.py”, line 80, in get_timedout_locks
for lock in os.listdir(locksdir):
OSError: [Errno 2] No such file or directory: ‘site1.local/locks’

Ran sudo supervisorct; status:

frappe:frappe-web RUNNING pid 5221, uptime 0:48:56
frappe:frappe-worker RUNNING pid 5220, uptime 0:48:56
frappe:frappe-workerbeat RUNNING pid 5228, uptime 0:48:56
node-socketio RUNNING pid 5248, uptime 0:48:56
redis-async-broker RUNNING pid 5245, uptime 0:48:56
redis-cache RUNNING pid 5250, uptime 0:48:56

Try

bench --site SITENAME enable-scheduler

1 Like

Tried and it enabled for site1.local. Tried to email still ‘not sent’.

Tried sudo supervisorctl status and this is what i get.

frappe:frappe-web RUNNING pid 11114, uptime 0:00:17
frappe:frappe-worker RUNNING pid 11113, uptime 0:00:17
frappe:frappe-workerbeat RUNNING pid 11121, uptime 0:00:17
node-socketio STARTING
redis-async-broker RUNNING pid 11128, uptime 0:00:17
redis-cache RUNNING pid 11143, uptime 0:00:17

node-socketio is stuck in STARTING.

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?