question

DryfishofNorwayManager-5708 avatar image
0 Votes"
DryfishofNorwayManager-5708 asked FabinCedeo-3566 commented

Connect Office 365 and Azure VM for Sending email

We need to use Office 365 to send email from one of our Azure VM.
Please kindly guide us for the same (Ex: Port need to open at VM level, settings need to use with Office 365).

Just for your information we are getting the following error message.

Message could not be sent. Mailer Error: SMTP connect() failed.

Test URL: https://api.dryfishofnorway.com/

We are using following configuration
Host: smtp.office365.com
Username: info@dryfishofnorway.com
Password: Account Password
Port: 587

azure-virtual-machines
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TKujala avatar image
0 Votes"
TKujala answered

Hi @DryfishofNorwayManager-5708,


You could do the SMTP test by using Microsoft Remote Connectivity Analyzer on Azure VM to get more detailed information about the connection.


https://testconnectivity.microsoft.com/tests/exchange


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FabioRomeroFlextime-4184 avatar image
0 Votes"
FabioRomeroFlextime-4184 answered FabinCedeo-3566 commented

Hi,

I have the same problem, to send emails from my VM in Azure to an Mail Exchange, the weird thing is that I can send from other servers, but Azure VM.

I have an Email App running in a VM and using an MX endpoint and port 25.

Is there any settings issue in my Azure VM?

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Azure have some restrictions when sending mail through TCP 25 port. Please read this document https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity

Hope this can help you,
Kind regards.
Fabián

0 Votes 0 ·
Alocyte-7764 avatar image
0 Votes"
Alocyte-7764 answered

TLS 1.2 being used? We had this issue, resolved by using TLS 1.2.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.