I have installed frappe helpdesk on the local network. I’m able to access it. On the “get started” section. I wanted to add an email account. I didn’t see any option to add my company email ID. So I decided to use Gmail. I entered my gmail id and password and checked enable outgoing and default outgoing. The gmail id and password is correct. But not able to create it , the error says : Failed to create email account, Invalid credentials. On the vscode , the error says :
”POST /api/method/helpdesk.api.settings.email.create_email_account HTTP/1.1”
Instead of password you need to use the app password
Checkout this : https://myaccount.google.com/u/0/apppasswords
Use a Gmail App Password
Go to: https://myaccount.google.com/security
- Enable 2-Step Verification.
- After enabling, you will see the App Passwords option.
- Create a new App Password for “Mail”.
- Copy the generated 16-character password.
I found the app passwords in google account. And created one as you said and copied the 16 character password . In frappe I used my gmail , pasted the 16 char password without space between them. And also put the Account name as Mail. Still the same error is showing. This time I checked the browser console for errors , and shows me :
Failed to load resource: the server responded with a status of 417 (EXPECTATION FAILED)
frappeRequest.js:77 Traceback (most recent call last):
File “apps/frappe/frappe/email/smtp.py”, line 75, in session
_session = SMTP(self.server, self.port, timeout=2 * 60)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/smtplib.py”, line 255, in init
(code, msg) = self.connect(host, port)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/smtplib.py”, line 341, in connect
self.sock = self._get_socket(host, port, self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/smtplib.py”, line 312, in _get_socket
return socket.create_connection((host, port), timeout,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/socket.py”, line 851, in create_connection
raise exceptions[0]
File “/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/socket.py”, line 836, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “apps/helpdesk/helpdesk/api/settings/email.py”, line 48, in create_email_account
email_doc.save()
File “apps/frappe/frappe/model/document.py”, line 499, in save
return self._save(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 521, in _save
return self.insert()
^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 428, in insert
self.run_before_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1313, in run_before_save_methods
self.run_method(“validate”)
File “apps/frappe/frappe/model/document.py”, line 1162, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1559, in composer
return composed(self, method, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1537, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1159, in fn
return method_object(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 185, in validate
self.validate_smtp_conn()
File “apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 215, in validate_smtp_conn
return server.session
^^^^^^^^^^^^^^
File “apps/frappe/frappe/email/smtp.py”, line 102, in session
frappe.throw(
File “apps/frappe/frappe/utils/messages.py”, line 145, in throw
msgprint(
File “apps/frappe/frappe/utils/messages.py”, line 106, in msgprint
_raise_exception()
File “apps/frappe/frappe/utils/messages.py”, line 57, in _raise_exception
raise exc
frappe.exceptions.ValidationError: Invalid Outgoing Mail Server or Port: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 121, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/init.py”, line 61, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/v1.py”, line 40, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 52, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1127, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/typing_validations.py”, line 36, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “apps/helpdesk/helpdesk/api/settings/email.py”, line 50, in create_email_account
frappe.throw(str(e))
File “apps/frappe/frappe/utils/messages.py”, line 145, in throw
msgprint(
File “apps/frappe/frappe/utils/messages.py”, line 106, in msgprint
_raise_exception()
File “apps/frappe/frappe/utils/messages.py”, line 57, in _raise_exception
raise exc
frappe.exceptions.ValidationError: Invalid Outgoing Mail Server or Port: [Errno 101] Network is unreachable
frappeRequest.js:81 Uncaught (in promise) Error: /api/method/helpdesk.api.settings.email.create_email_account ValidationError
at Object.transformResponse (frappeRequest.js:81:17)
at async Proxy.a (resources.js:103:18)
Hope you have selected the Service as Gmail in Email Account. Can you please share a screenshot is possible?
It’s showing Invalid Outgoing Email Server or Port network unreachable error. Can you switch to the Desk view and configure Email account form Email account list.
How to switch to desk view and configure email account form email account list ?
Gmail won’t work with your normal password. You must create a Google App Password.
Fix:
-
Enable 2-Step Verification in your Google account.
-
Go to Security → App Passwords and generate a 16-character password.
-
Use your Gmail ID + that App Password in Frappe Helpdesk.
-
Make sure IMAP is enabled in Gmail settings.Then the email account will save without the “Invalid credentials” error.
Ohh. I’m in Desk view. Is there any youtube video showing connecting gmail or custom email to frappe helpdesk ?



