After upgrade to V14 getting error Invalid Outgoing Mail Server or Port

I have tried both Gmail and Microsoft. Both were working in V13 but after upgrade outgoing emails have stopped. I have used following link to setup microsoft email

Office 365 settings - Frappe Framework - Frappe Forum

Can anybody suggest how to do this?
Thanks in advance.

Is your scheduler running?

Look for email queue list in awesome bar

Checked Email queue, it shows Error.

I have also tried with OAuth. The Connected app is working and getting the required tokens. But when I press Authorize API access for the email account. It throws following error after the Microsoft signup window:

Traceback (most recent call last):
File “apps/frappe/frappe/”, line 66, in application
response = frappe.api.handle()
File “apps/frappe/frappe/”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/”, line 83, in execute_cmd
return, **frappe.form_dict)
File “apps/frappe/frappe/”, line 1607, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/integrations/doctype/connected_app/”, line 149, in callback
frappe.throw(_(“Invalid state.”))
File “apps/frappe/frappe/”, line 525, in throw
File “apps/frappe/frappe/”, line 493, in msgprint
File “apps/frappe/frappe/”, line 442, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Invalid state.

Please can somebody help with this error.

Can somebody suggest what should be the scope for email default sending account. I am using folllowing scopes:


I wonder why the basic authentication with m365 ( with connector, ip address) which was working in v13 throws an error in v14 as:

Invalid outgoing mail server or port

Can somebody check and see if this is caused by some validation script which is not allowing the unusual smtp server as :
Port 25

The above configuration with basic authentication is working in v13 till date but same configuration fails in v14. We are currently running two droplets one with v13 which is used by our organization and another upgraded to v14 which is under trials before the switchover. Hope this resolves soon as without this we would be stuck at v13.

Thanks in advance


A different port has been tried?