Jump to content

Sending eMails properly formated for Outlook


filipedine

Recommended Posts

Hi to all ,I've been using this code to send mails via HTML, but when a user downloads this message to the MsOutlook the message sent gets all scrambel. Can any one help me?I am using the folowing code:Imports System.Net.Mail... 'Obtain the Network Credentials from the mailSettings section Dim credential As New System.Net.NetworkCredential(arrUser(0), strPass) 'Create the SMTP Client Dim client As New SmtpClient() client.Host = strSMTPServer client.DeliveryMethod = SmtpDeliveryMethod.Network client.Credentials = credential 'Build Email Message Dim email As New MailMessage email.From = New MailAddress(strFrom) email.To.Add(strTo) email.Subject = strSubject email.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure 'Location of filename FILE_NAME = locationfiles & strFileName Dim strMessageBody As String = "<HTML><BODY><P><B>WORLD HI</B><BR>COME AND GET ME EXEMPLE EXEMPLE EXEMPLE EXEMPLE </P><BODY></HTML>" email.Body = strMessageBody email.IsBodyHtml = True 'Send email client.Send(email) 'Clean Up client = Nothing email = Nothing...ThanksFilipe

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...