locked
SQL Server Database Mail RRS feed

  • Question

  • I have a Win Server 2003, running SQL Server 2005. I wanted to configure email sending in SQL Server (Database Mail) using O365 with the following parameter:

    - smtp.office365.com / 587
    - basic authentication

     

    From server, I can ping to smtp.office365.com and telnet to port 587, but I hit the error while sending the mail:

    Message
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2020-03-05T10:31:22). Exception Message: Cannot send mails to mail server. (Failure sending mail.).
    )

     

    I tried with another SMTP host (without SSL), have no problem sending email. I suspect it has something to do with SSL?

     

    Any idea where went wrong?

    Thursday, March 5, 2020 1:48 PM

All replies

  • Did you go through "Database Mail Configuration Wizard" and see the account exists?

    A Fan of SSIS, SSRS and SSAS

    Thursday, March 5, 2020 3:11 PM
  • Hi Guoxiong,

    The account exists for sure, is an existing account. I amended the server detail and port number, then I do a "Send Test Email". Which then I received the error.

    I just switched to Office365 recently.

    My previous mail server works with the SQL Database Mail, but is not using SSL. I tried enabled SSL for my previous SMTP host, the email sending failed as well.

    So i was wondering is the SQL Server not able to send with SSL?

    OR can i setup O365 without SSL?

    Thanks.

     
    Friday, March 6, 2020 6:34 AM
  • Check with telnet for smtp port. And may be restriction ip list in smtp server. In this case must add your database server ip in list of restrictions ip.

    Best Regards,

    Natig


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    Friday, March 6, 2020 7:16 AM
  • To send emails using Office365 server enter these details:

    SMTP Host: smtp.office365.com
    SMTP Port: 587
    SSL Protocol: OFF
    TLS Protocol: ON
    SMTP Username: (your Office365 username)
    SMTP Password: (your Office365 password)

    Also make sure that your:

    1. "From" email in HESK settings (General tab) is set to your Office365 email address
    2. "From" name in HESK settings (General tab) is NOT set to an email address - Microsoft security policies will reject sending emails if the From name is an email address

     

    » POP3 fetching

    To fetch mail from Office365 server enter these details:

    POP3 Host: outlook.office365.com
    POP3 Port: 995
    TLS Protocol: ON
    POP3 Username: (your Office365 username)
    POP3 Password: (your Office365 password)

     

    » IMAP fetching

    To fetch mail from Office365 server using IMAP protocol instead, enter these details:

    IMAP Host: outlook.office365.com
    IMAP Port: 993
    Encryption: SSL
    IMAP Username: (your Office365 username)
    IMAP Password: (your Office365 password

    Friday, March 6, 2020 7:17 AM
  • To send emails using Office365 server enter these details:

    SMTP Host: smtp.office365.com
    SMTP Port: 587
    SSL Protocol: OFF
    TLS Protocol: ON
    SMTP Username: (your Office365 username)
    SMTP Password: (your Office365 password)

    Also make sure that your:

    1. "From" email in HESK settings (General tab) is set to your Office365 email address
    2. "From" name in HESK settings (General tab) is NOT set to an email address - Microsoft security policies will reject sending emails if the From name is an email address

     


    Hi,

    How to disable SSL and enable TLS? In the Database Mail, there is only one checkbox. There is no TLS options:

    Friday, March 6, 2020 12:05 PM
  • Check with telnet for smtp port. And may be restriction ip list in smtp server. In this case must add your database server ip in list of restrictions ip.

    Best Regards,

    Natig


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    Hi,

    Yes, I can "telnet smtp.outlook365.com 587" successfully. Ping is working as well.

    Thanks.
    Friday, March 6, 2020 12:07 PM
  • Hi All,

    I have setup SMTP relay in Office 365, and point the server in SQL Server DB Mail to the relay server without the need of SSL.

    The mail is able to send out. Will put under observation for now.

    Thanks for your comment.
    Friday, March 6, 2020 5:36 PM