Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Sameer100
Starting Member
3 Posts |
Posted - 2007-09-28 : 03:41:50
|
Hi,In SSIS Scipt task, with all variables assigned.With the below code i was able to send mails, But after receiving it, there is no Attachment.N.B:- Similar issue is raised by some other guy in http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2157275&SiteID=1"http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2155181&SiteID=1" and i dont think he got the resolution.Public Sub Main() Dim smtpServer As String = Dts.Variables("MailSMTPServer").Value.ToString Dim htmlMessageTo As String = Dts.Variables("ToLine").Value.ToString Dim htmlMessageFrom As String = Dts.Variables("FromLine").Value.ToString Dim htmlMessageSubject As String = Dts.Variables("MailSubj").Value.ToString Dim htmlMessageBody As String = Dts.Variables("MailBody").Value.ToString Dim htmlMessageLog As String = Dts.Variables("ErrorLog2").Value.ToString Dim htmlMessage As MailMessage Dim mySmtpClient As SmtpClient Dim m As New System.Net.Mail.MailMessage Dim AttachLog As Attachment = New Attachment(htmlMessageLog) htmlMessage = New MailMessage(htmlMessageFrom, htmlMessageTo, htmlMessageSubject, htmlMessageBody) mySmtpClient = New SmtpClient("<SMTP Server name>") m.Attachments.Add(AttachLog) mySmtpClient.Credentials = New NetworkCredential("<emailid>", "<password>") mySmtpClient.Send(htmlMessage) Dts.TaskResult = Dts.Results.SuccessEnd SubPlease let me know, how can i see Attachment in my mail.Thanks. |
|
klubell
Starting Member
4 Posts |
|
|
|
|