Thursday, 8 August 2013

ssis smtp mail ,how to mention the port number if the port number is not 25

ssis smtp mail ,how to mention the port number if the port number is not 25

It has benn understood that the smtp mail task does not work if the port
number is not 25.So found some script to do the work from the link
http://englestone.blogspot.co.uk/2008/05/ssis-send-mail-task-change-smtp-port.html
when modified as per my needs it shows an error sayin that SMTP server
requires a secure connection or the client was not authenticated question
is how to add the secure connection section on this vb code or is this
error is ue to authentication then the code corresponding to
authentication is correct?
Public Sub Main() Dim myHtmlMessage As MailMessage Dim mySmtpClient As
SmtpClient
myHtmlMessage = New MailMessage("sender@s.com", "receiver@s.com",
"subject", "body")
mySmtpClient = New SmtpClient("send.company.net")
mySmtpClient.Port = 587
mySmtpClient.Credentials =
CredentialCache.DefaultNetworkCredentials("sender@s.net", "sender
email pwd")
mySmtpClient.Send(myHtmlMessage)
Dts.TaskResult = ScriptResults.Success
End Sub
Any Vb network expert please reply

No comments:

Post a Comment