How basic authentication affects an SSIS Script Task to send SMTP mail with Office 365

David Plus 21 Reputation points
2022-12-07T01:32:23.417+00:00

We are using in Sql Server Integration Services 2016 a Script Task, which sends mail using the namespace

  using System.Net;  
  using System.Net.Mail;  


 Microsoft documentation states that SSIS does not use basic authentication, but anonymous and windows authentication. However, I would like to know if the removal of basic authentication affects this development since it is in a task script and not using the SMTP tool itself. This process is currently used to automatically send communications to customers.  
 

The code segment where the authentication is performed is the following:

Cliente SmtpClient = nuevo SmtpClient

        {  

            UseDefaultCredentials = falso,  

            Credenciales = nuevo System.Net.NetworkCredential(User, Pass),  

            Anfitrión = Servidor,  

            EnableSSl = verdadero,  

            Nombre de destino = "STARTTLS/ smtp.office365.com ",  

            Puerto = PortInt,  

            DeliveryMethod = SmtpDeliveryMethod.Network,  

            Tiempo de espera = 50000,  

        };  

what should I do

Thanks

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

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 33,296 Reputation points
    2022-12-07T01:44:24.277+00:00

    Hi @David Plus ,

    Code writing is out of my ability, take a reference to below links to see if it is helpful.

    https://social.msdn.microsoft.com/forums/sqlserver/en-US/1d527cab-370b-4cb2-a0eb-3d754f23a39e/ssis-email-task-office-365?forum=sqlintegrationservices

    https://www.tutorialgateway.org/script-task-in-ssis/

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Yitzhak Khabinsky 25,116 Reputation points
    2022-12-07T02:19:59.34+00:00

    Hi @David Plus ,

    Microsoft documentation states that SSIS does not use basic authentication, but anonymous and windows authentication.

    It is referring to the built-in SSIS Send Mail Task.

    When you are using SSIS Script Task to send emails it is not applicable.
    It is totally up to your c#/VB.Net code how security is handled.

    0 comments No comments