Connect Office 365 and Azure VM for Sending email

Dryfish of Norway® - Manager 1 Reputation point
2020-06-24T07:19:02.7+00:00

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
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,123 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. T. Kujala 8,701 Reputation points
    2020-06-29T11:11:20.137+00:00

    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

    0 comments No comments

  2. Fabio Romero | Flextime 1 Reputation point
    2021-01-29T11:09:45.607+00:00

    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?


  3. Alocyte 1 Reputation point
    2022-05-23T09:30:26.45+00:00

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

    0 comments No comments