Torna al Thread

Dim SMTP_CREDENTIAL As System.Net.NetworkCredential SMTP_CREDENTIAL = New System.Net.NetworkCredential("user_smtp", "password_smtp", "dominio.it") Dim theEmail As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage Dim theSender As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient() theSender.Credentials = SMTP_CREDENTIAL theSender.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network theEmail.From = New System.Net.Mail.MailAddress("sender@email.it") theEmail.To.Add(New System.Net.Mail.MailAddress("receiver@dibiasi.it")) theEmail.Subject = "oggetto della mail" Dim theAttach As System.Net.Mail.Attachment Dim itAtt As String '# allegati della mail theAttach = New System.Net.Mail.Attachment("C:\Windows.old\Windows\boot.bmp") theEmail.Attachments.Add(theAttach) ' body html (qui dovresti inserire la struttura HTML della broschure) theEmail.IsBodyHtml = True theEmail.Body = "<center>NEWSLETTER</CENTER><BR/>test immagine in corpo email<br/><img src=""C:\Windows.old\Windows\boot.bmp""/>""" theSender.Host = "SMTP_IP_ADDRESS" theSender.Port = "25" Try theSender.Send(theEmail) MsgBox("Messaggio inviato correttamente", MsgBoxStyle.Information) theSender = Nothing theEmail.Dispose() : theEmail = Nothing Me.Close() Exit Sub Catch MsgBox(Err.Description) End Try
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5