To set up an SMTP connection with Office 365, follow these steps:
  1. Go to Settings > Mail.
  2. Under Connection type, select SMTP.
  3. Enter the following information:
    • SMTP Host: smtp.office365.com
    • SMTP Port: 587
    • SMTP Username: Your Office 365 email address
    • SMTP Password: Your Office 365 app password
    • SMTP Security: TLS
  4. Click Save.
To generate an app password:
  1. Go to Office 365 account > Settings > Security & privacy > App passwords.
  2. Click Create a new app password.
  3. Enter a name (e.g. ETO) for the app password and select Other app from the drop-down menu.
  4. Click Create.
  5. Copy the app password and save it in a secure place.
Once you have configured the SMTP settings, you can send a test email to verify the connection. To do this:
  1. Go to Settings > Mail.
  2. Click Send a test email.
  3. Enter your email address in the field and click Send.
If you receive a test email successfully, the SMTP connection is configured correctly and you can start sending emails from your application.

FAQs
Q: What is an app password?
A: An app password is a unique password that you can generate for each application that needs to access your Office 365 account. App passwords are more secure than using your regular Office 365 password, as they cannot be used to log into your account directly.