Database Mail to work on Azure VM

  • Trying to get Database mail working sending via or port 587 using  SSL

    Running on SQL 2019 on Windows server 2019. The machine is a VM on Azure. Port 587 is open

    Get a very generic error

    The mail could not be sent to the recipients because of the mail server failure. Exception Message: Cannot send mails to mail server. (The operation has timed out.).

    A physical SQL server machine with same account details works.

    I thought it could be TLS issue because event viewer had SChannel error at the same time I was trying to send emails.

    : "A fatal error occurred while creating a TLS client credential. The internal error state is 10013."

    I did add these reg entries (But in my case for .Net 4 Database mail config file has 4.6)

    After trying these and restarting machine and SQL Service (several times) I can see that Schannel error 10013 doesn't correlate to when I tested emails. So hours later I think it could be a red herring. I also believe SQL 2019 does support TLS 1.2 by default.

    A PS simple email script works on Physical machine but not on the Azure VM. So it's not just a Database mail issue.

    Any thing else I can try I'm stumped..



  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • Do you have a Azure VPN resource setup for your VM SQL server or just your Azure VM box?

    This could solve your problem.

    Please check out this link:


    + I would setup on a sandbox before implementing on the live site.



  • I don't know our Azure setup, probably wouldn't understand it anyway

    I'm going to ask to get Sendgrid setup, from what I see its free up to 100 emails per day.

    Would like to know where it's blocked though as simple Powershell test network connectivity on port 587 to  works..



Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply