SSIS SendMail Task not working- using Visual Studio 2019

Dyanna Hess-Miller 61 Reputation points
2020-10-19T23:22:13.39+00:00

I'm trying to send a file to my Office 365 email using SEND MAIL TASK.
I've been reading that:
"The SMTP Task in SSIS only supports Windows Authentication and the port number cannot be changed. For a SMTP server that uses non-Windows Authentication, we can use SmtpClient Class in Script Task to send the email"

Is there a fix for this?

Error I'm getting:

[Send Mail Task] Error: An error occurred with the following error message:
"Failure sending mail. System.Net.WebException: Unable to connect to the remote server
System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network [2603:1036:302:4836::2]:25".

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,474 questions
{count} votes

Accepted answer
  1. Yitzhak Khabinsky 25,211 Reputation points
    2020-10-20T00:29:45.843+00:00

    Hi @Dyanna Hess-Miller ,

    SSIS built-in Send Email Task was designed for a on prem. corporate environment email server like MS Exchange. That's the origin for the current limitations.

    It seems that you would need to use SSIS Script Task for emailing.

    This link has all the SMTP settings details for Microsoft Office 365: office-365-smtp-settings


1 additional answer

Sort by: Most helpful
  1. Monalv-MSFT 5,896 Reputation points
    2020-10-20T08:29:34.013+00:00

    Hi @Dyanna Hess-Miller ,

    Hope the following links will be helpful:

    SEND MAIL Task failure error:Unable to connect to the remote server System.Net.Sockets.

    Send Mail Task Error: An error occurred with the following error message: "Failure sending mail. System.Net.WebException: Unable to connect to the remote server System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbid

    Best Regards,
    Mona

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.