Sending email error code ..cant sent email

{‘retry’: 0, ‘log’: <function log at 0xb540d7d4>, ‘site’: u’erpnext.vm’, ‘event’: u’sendmail’, ‘method_name’: u’sendmail’, ‘method’: <function sendmail at 0xb540f1ec>, ‘user’: u’cpsolution.web@gmail.com’, ‘kwargs’: {‘lang’: u’en’, ‘attachments’: [], ‘recipients’: [u’dysoco.jinema@gmail.com’], ‘cc’: [], ‘print_html’: u’‘, ‘session’: {u’data’: {u’session_expiry’: u’06:00:00’, u’session_country’: None, u’csrf_token’: u’a0058704dc73e3b27f515a6bb10a99fb99b2ee418349dd424cbd8991’, u’last_updated’: ‘2017-12-17 16:07:37.394687’, u’lang’: u’en’, u’user_type’: u’System User’, u’user’: u’cpsolution.web@gmail.com’, u’full_name’: u’Administrator’, u’device’: u’desktop’, u’session_ip’: u’10.0.2.2’}, u’user’: u’cpsolution.web@gmail.com’, u’sid’: u’035f37bb4f5f0ecc65ff381caaef27f3ee9364050792114ce27a5c17’}, ‘communication_name’: ‘8070ddd708’, ‘print_format’: u’‘}, ‘async’: True, ‘job_name’: u’<function sendmail at 0xb4c60a04>'}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 92, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 435, in sendmail
recipients=recipients, cc=cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 209, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 164, in _notify
is_notification=True if doc.sent_or_received ==“Received” else False
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 432, in sendmail
inline_images=inline_images, header=header)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 67, in send
email_account = get_outgoing_email_account(True, append_to=reference_doctype, sender=sender)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 70, in get_outgoing_email_account
frappe.OutgoingEmailError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
OutgoingEmailError: Please setup default Email Account from Setup > Email > Email Account

Please setup default Email Account from Setup > Email > Email Account

still Got an error…

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 290, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 808, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 702, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 965, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 948, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 696, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 66, in validate
self.get_incoming_server()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 163, in get_incoming_server
email_server.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 44, in connect
return self.connect_imap()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 52, in connect_imap
self.imap = Timed_IMAP4_SSL(self.settings.host, timeout=frappe.conf.get(“pop_timeout”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 550, in init
self._super.init(self, *args, **kwargs)
File “/usr/lib/python2.7/imaplib.py”, line 1165, in init
IMAP4.init(self, host, port)
File “/usr/lib/python2.7/imaplib.py”, line 172, in init
self.open(host, port)
File “/usr/lib/python2.7/imaplib.py”, line 1176, in open
self.sock = socket.create_connection((host, port))
File “/usr/lib/python2.7/socket.py”, line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 935, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 290, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 808, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 702, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 965, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 948, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 696, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 66, in validate
self.get_incoming_server()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 163, in get_incoming_server
email_server.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 44, in connect
return self.connect_imap()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 52, in connect_imap
self.imap = Timed_IMAP4_SSL(self.settings.host, timeout=frappe.conf.get(“pop_timeout”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 550, in init
self._super.init(self, *args, **kwargs)
File “/usr/lib/python2.7/imaplib.py”, line 1165, in init
IMAP4.init(self, host, port)
File “/usr/lib/python2.7/imaplib.py”, line 172, in init
self.open(host, port)
File “/usr/lib/python2.7/imaplib.py”, line 1176, in open
self.sock = socket.create_connection((host, port))
File “/usr/lib/python2.7/socket.py”, line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known

You can try a forum search, there are similar posts.

i will try im stuck at here … im trying to fix it… the tutorial on how to setup your email in youtube is different …thank you!

It sounds like email account configuration issue - also you can try the settings on any other email client and see if its correct.

im a newbee at this can you give steps on how to configure the settings on any other email client??

The error is specifically about the hostname. Make sure you have the correct imap inbound and smtp outbound mail server addresses.

@cpsolution, can you show us the details that you used for the email account, especially the IMAP, SMTP, service, domain, etc?

i dont know how to configure it… im trying to create an new email account check the photos below. i dont know how to setup the domain. When i try to save it says Request Time out.

Try unchecking use imap and set the email sever as pop.gmail.com. Also, login to the email account that you are using and enable “Allow less secure apps” by following these steps: Less secure apps & your Google Account - Google Account Help

Thanks i already fixed it… Thank you for your help!

1 Like