Emails are drafting only (I have to manually send the emails from email queue)

Hi,

My emails are not sending, actully when I try to send a mail or initiate a communication the mails goes to email queue only, Then I have to manually send the mail to the receipient by clicking on “Send Now” button.

Is there anything I can do to send mails directly. I do not want it to be send manually.

also there is problem of incoming emails. I’m not receiving any incoming mails. I have done the required settings but still not able to receive mails.

I’m new here, so please forgive any mistakes and feel free to guide me if needed.

Thank you.

Hi @harshvadhiya,

If the scheduler is active, it will automatically send it every 60 seconds. No need to click “Send Now”.
Try and check it.

Thank You!

Hi @NCP ,

I successfully enabled the scheduler by
bench --site all enable-scheduler
it returned
Enabled for frontend
but the issue is not resolved.

Hi @harshvadhiya,

Please check the whole topic.

Thank You!

Hi @NCP ,
It didn’t worked either.

have you maybe suspended emails?

Do you have RQ workers working on scheduled jobs?

Hi @ankush ,

I have not suspended emails…

but when I open RQ Workers tab, it gives an error

in RQ Jobs

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 132, in send
    ctx.fetch_smtp_server()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 216, in fetch_smtp_server
    self.email_account_doc = self.queue_doc.get_email_account(raise_error=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 107, in get_email_account
    return frappe.get_cached_doc("Email Account", self.email_account)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1095, in get_cached_doc
    doc = get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1186, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 75, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 107, in __init__
    self.load_from_db()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 148, in load_from_db
    frappe.throw(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 536, in throw
    msgprint(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 504, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 450, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: Email Account Harsh Vadhiya not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 1418, in perform_job
    rv = job.perform()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/job.py", line 1225, in perform
    self._result = self._execute()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/job.py", line 1262, in _execute
    result = self.func(*self.args, **self.kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 191, in execute_job
    retval = method(**kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 195, in send_mail
    record.send(smtp_server_instance=smtp_server_instance)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 131, in send
    with SendMailContext(self, smtp_server_instance) as ctx:
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 235, in __exit__
    self.smtp_server.quit()
AttributeError: 'NoneType' object has no attribute 'quit'

Check this …

actually I do have account by the name “Harsh Vadhiya” it set to Default Sending and Inbox.

also when I’m sending mails by pressing “Send Now” button from email queue. It sends without any error.

image

Hi @ankush ,
I have enabled now, what to do next?