J
Jeffrey Walton
Hi All,
How does one send a plain text email using System.Net.Mail?
In the code below, I am *not* able to stop the MIME encoding. When I
examine the received message, the string is "Test 1=0D=0ATest 2". I
verified the message *was* MIME encoded when leaving my machine using
Wireshark.
Thanks,
Jeff
Dim mail As New MailMessage()
mail.BodyEncoding = Text.Encoding.ASCII
mail.SubjectEncoding = Text.Encoding.ASCII
mail.IsBodyHtml = False
'set the addresses
mail.From = New MailAddress("(e-mail address removed)")
mail.ReplyTo = New MailAddress("(e-mail address removed)")
mail.To.Add("(e-mail address removed)")
'set the subject and body
mail.Subject = "Test"
mail.Body = "Test 1" & vbCrLf & "Test 2"
'send the message
Dim smtp As New SmtpClient()
smtp.Send(mail)
How does one send a plain text email using System.Net.Mail?
In the code below, I am *not* able to stop the MIME encoding. When I
examine the received message, the string is "Test 1=0D=0ATest 2". I
verified the message *was* MIME encoded when leaving my machine using
Wireshark.
Thanks,
Jeff
Dim mail As New MailMessage()
mail.BodyEncoding = Text.Encoding.ASCII
mail.SubjectEncoding = Text.Encoding.ASCII
mail.IsBodyHtml = False
'set the addresses
mail.From = New MailAddress("(e-mail address removed)")
mail.ReplyTo = New MailAddress("(e-mail address removed)")
mail.To.Add("(e-mail address removed)")
'set the subject and body
mail.Subject = "Test"
mail.Body = "Test 1" & vbCrLf & "Test 2"
'send the message
Dim smtp As New SmtpClient()
smtp.Send(mail)