TwentyT
Twenty2y ago
8 replies
ddimarx

Email SMTP Office365 Server configuration Issue

Hello! I'm self-hosting twenty using Docker Compose and I've tried to configure Email SMTP Office365 Server according to https://docs.twenty.com/start/self-hosting/

I've added the following in .env file
---------------

EMAIL_FROM_ADDRESS=my_office365_email_address
EMAIL_FROM_NAME=my_office365_email_address
EMAIL_SYSTEM_ADDRESS=my_office365_email_address
EMAIL_DRIVER=smtp
EMAIL_SMTP_HOST=smtp.office365.com
EMAIL_SERVER_PORT=587
EMAIL_SERVER_USER=my_office365_email_address
EMAIL_SERVER_PASSWORD='my_office365_password'

---------------

And added the related environment variables in the docker-compose.yml

---------------

LOGGER_DRIVER: 'console'
EXCEPTION_HANDLER_DRIVER: 'console'
LOG_LEVELS: 'log'

EMAIL_FROM_ADDRESS: ${EMAIL_FROM_ADDRESS}
EMAIL_FROM_NAME: ${EMAIL_FROM_NAME}
EMAIL_SYSTEM_ADDRESS: ${EMAIL_SYSTEM_ADDRESS}
EMAIL_DRIVER: ${EMAIL_DRIVER}
EMAIL_SMTP_HOST: ${EMAIL_SMTP_HOST}
EMAIL_SERVER_PORT: ${EMAIL_SERVER_PORT}
EMAIL_SERVER_USER: ${EMAIL_SERVER_USER}
EMAIL_SERVER_PASSWORD: ${EMAIL_SERVER_PASSWORD}

---------------

But when i tried to test this "SMTP Office365 Server" configuration by trying to sent a "Forgot your password?" to one of the already created users, i get the following ERROR:
---------------
Server-1 | [Nest] 1 - 04/29/2024, 1:19:28 PM ERROR [SmtpDriver] sending email to 'my_office365_email_address': Error: Mail command failed: 530 5.7.57 Client not authenticated to send mail. [AM0PR10CA0070.EURPRD10.PROD.OUTLOOK.COM 2024-04-29T13:19:28.818Z **]
---------------

I've also setup an App Password and use it as EMAIL_SERVER_PASSWORD but I still get the same error .

Is it possible that I need to setup an other environment variables that will define the "EMAIL_SERVER_ENCRYPTION" with STARTTLS/TLS/NONE options that usually SMTP Office365 Server configuration it requires.
Twenty is a CRM designed to fit your unique business needs.
Welcome | Twenty - Documentation
Was this page helpful?