Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I Specify Credentials for Simple Authentication in SSIS SMTP Connection Manager?

We have several asp.net web apps that send emails, and the MailMessage object is configured with an SMTP server, username and password. The emails are sent with no problems.

In an SSIS package, I added an SMTP connection manager, and I configured the smtp server. I set UseWindowsAuthentication=True because I don't see where I type in username/password.

When I run the package from SQL Server Agent, the SSIS sends the email correctly, so apparently, the user/password is not needed.

So how can the SMTP package send an email without the user credentials? Does it make sense that the asp.net don't need the credentials either?

We're all under the same company network and we use Exchange Server.

Thanks.

like image 601
fdkgfosfskjdlsjdlkfsf Avatar asked Apr 26 '17 14:04

fdkgfosfskjdlsjdlkfsf


1 Answers

Create a SMTP Connection Manager with a parameterized ConnectionString property with a string which contains the smtp user and password.

  1. Create connection using New Connection... option selecting SMTP as type.
  2. Save without any connection settings. Give it any name you want.
  3. Right click the connection and select Parameterize...
  4. Select Property = ConnectionString
  5. Select Create new parameter (e.g. SMTPConnectionManager_ConnectionString)
  6. Set Value to connection string (e.g. SmtpServer=aspmx.l.google.com; port=25; UseWindowsAuthentication=False;EnableSsl=False; [email protected]; password=password123)
  7. Set scope at appropriate level for your deployment method (Package or Project).
  8. Click OK
like image 73
Alan Gaylor Avatar answered Sep 29 '22 07:09

Alan Gaylor