We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Email does not respect TransferEncoding

I am trying to send an email using SMTP with both a plain text and html body. I want the plain text view to have a TransferEncoding=SevenBit and ContentType=ASCII. However it doesn't seem to matter what I set the TransferEncoding to as it always arrives as 'quoted-printable'.

If I save the message before sending it and view the file it is correct...

Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

but when it arrives in Gmail I get this...

Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

The code is as follows:

Dim mEmail As MailMessage = New MailMessage()
mEmail.From = "from@address.com"
mEmail.Subject = "Test Email"
Dim plainTextView = AlternateView.CreateAlternateViewFromString("Test body", System.Text.Encoding.ASCII, System.Net.Mime.MediaTypeNames.Text.Plain)
plainTextView.TransferEncoding = Mime.TransferEncoding.SevenBit

Dim htmlBody = String.Format("{0}", "Test body")
Dim altView = AlternateView.CreateAlternateViewFromString(htmlBody, System.Text.Encoding.UTF8, System.Net.Mime.MediaTypeNames.Text.Html)
altView.TransferEncoding = Mime.TransferEncoding.Base64

' Save as a file
Dim so = SaveOptions.CreateSaveOptions(MailMessageSaveType.EmlFormat)
mEmail.Save(saveFile, so)

Dim client As SmtpClient = New SmtpClient()
client.Host = "smtp.myserver.com"

Hi David,

We have analyzed this issue at our end and found that even if the message is not sent via Aspose.Email API, the quoted-printable is still there in the received email at Gmail end. We tested this by sending out an email from our Outlook account. Thus, it seems to be an issue at the servers involved in communicating the email over the network. Please let us know if we can be of any additional help to you.