Unable to send outgoing email via Gmail and/or Google Apps

Our company is currently in the testing phase of deploying ERPNext, and while the software is phenomenal compared to what we were using originally (Quickbooks Professional), I am having an extremely difficult time sending outgoing emails.

We are using the VM hosted on a Windows server with the following port configuration:

Rule2 - TCP - Host: 8696 - Guest: 8080
Rule3 - TCP - Host: 2333 - Guest: 22
Rule4 - TCP - Host: 4306 - Guest: 3306

The Email settings I have setup currently are as such.

Service: GMail

Email ID: {user’s email} (Same as their Gmail ID)

Password: {GMail Password}

Enable Incoming: Unchecked

Enable Outgoing: Checked

SMTP Server: smtp.gmail.com

Use TLS: Checked

Port: 587

Default Outgoing: Unchecked on this one since it is for a single user, me.

Whenever, I attempt to email a Purchase Order, and other document types, nothing happens. No error message, nothing. If I look at the Bulk Email List, I can see all the records cued up, but they all have a “Not Sent” status.

What is really weird is that emails DO indeed appear to be working in some cases. For example, if a user registers for an account, they will receive an email from the address that is setup under Support, but if I attempt to send documents, it is a no go. Is this a potential bug that needs resolving, or is there a step that I am missing. Any assistance would be appreciated.

Also, I’ve also attempted to use Mandrill as well, with no luck. I can input the credentials without any problems, but upon trying to actually send something, it just dismisses it in the same fashion that it does when I attempt to send through Google.

Alright, I figured it out. Here is what I had to do, in case anyone else is having this issue:

Remove the scheduler.locks file by doing the following from the terminal:

{site-name}:~$   rm frappe-bench/sites/{site-name}/locks/scheduler.lock

After I did that, outgoing emails started going out. I’m really not sure what the scheduler.lock file does, but I seriously think that there should be some mention of it in the manual for people who are trying the software out. It could potentially save someone hours of headaches, and forum crawling trying to find the solution. In fact, an entire page devoted to troubleshooting easily solvable problems in the manual would be very welcome.


@dsslrbrandon welcome to the forum.

Scheduler lock is just a flag to stop the scheduler and it is set while the system is updating and then deleted afterwords. Did any of your update break?

hiii i am using erp version 4 and i have problem regarding incoming emails

Hi am senthil
i’m configured ERP next VMware in windows 7 , i finish my email setting but mail not seciver or send in this server side plese hep to solve this issues ??
contact : senthil_it@rathinamtechzone.com


I am facing problems with outgoing emails on my fresh install of ERPNext. Can you please help

Could you provide a screen shot of the error you are facing? Which version etc.

You have to generate App password,not using gmail account password


Thanks for your revert, enclosed are the screen shot. I am on
ERPNext: v8.1.3 (master)
Frappe Framework: v8.1.2 (master)

Btw, Incoming seems to be working fine. The issues is just with sending the emails out of ERPNext

Hope that your outgoing port is open on the network.

Yes it is…below is my security group config on AWS

Can you share screen shots of your domain configuration for Gmail?

Below is the latest traceback:
[Errno 110] Connection timed out
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 373, in send_one
smtpserver.sess.sendmail(email.sender, recipient.recipient, encode(message))
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 194, in sess
raise_(frappe.ValidationError, e, traceback)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 167, in sess
cint(self.port) or None)
File “/usr/lib/python2.7/smtplib.py”, line 256, in init
(code, msg) = self.connect(host, port)
File “/usr/lib/python2.7/smtplib.py”, line 316, in connect
self.sock = self._get_socket(host, port, self.timeout)
File “/usr/lib/python2.7/smtplib.py”, line 291, in _get_socket
return socket.create_connection((host, port), timeout)
File “/usr/lib/python2.7/socket.py”, line 575, in create_connection
raise err
ValidationError: [Errno 110] Connection timed out

Screenshot of domain config:

Any advises on this? I am still struggling with the sending emails out of the system

Hello srivatstats

For setup tips, checks and so on please search ‘gmail fussy’ or ‘gmail setup’

have fun

Edit: On rereading this I see gmail applied in the original post and not this case -

Can you connect from another client, to verify the connection works?

This suggests your problem is with the remote side and not the client.

1 Like