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

Free Support Forum - aspose.com

Mail Subject Encoding - Text garbled on iPhone and Mac

Hey Aspose

We sometimes get the subjects of Messages messed up (see screenshots).

Subject:
Valentin Hernandez Lima hat Geschäftsbrief 14251 erledigt

This is how the header details look:

Return-Path: info@supertext.ch
Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46])
by slots14b1p3 (Cyrus git2.5+0-git-fastmail-7540) with LMTPA;
Wed, 07 Dec 2011 13:48:08 -0500
X-Sieve: CMU Sieve 2.4
X-Spam-charsets: subject=‘utf-8’, plain='utf-8’
X-Resolved-to: supertext@fastmail.fm
X-Delivered-to: info@supertext.ch
X-Mail-from: info@supertext.ch
Received: from mx4.nyi.mail.srv.osa ([10.202.2.203])
by compute6.internal (LMTPProxy); Wed, 07 Dec 2011 13:48:08 -0500
Received: from DED191.maximumasp.com (ded191.maximumasp.com [209.162.186.147])
by mx4.nyi.mail.srv.osa (Postfix) with ESMTP id E2C20180C9E
for info@supertext.ch; Wed, 7 Dec 2011 13:48:07 -0500 (EST)
Received: from DED191.maximumasp.local ([209.162.186.147]) by DED191.maximumasp.com with Microsoft SMTPSVC(7.5.7600.16544);
Wed, 7 Dec 2011 13:48:06 -0500
From: “Supertext System” info@supertext.ch
To: “Supertext Crew” info@supertext.ch
Subject:
=?utf-8?B?VmFsZW50aW7CoEhlcm5hbmRleiBMaW1hIGhhdCBHZXNjaMOkZnRzYnJpZWbC?=
=?utf-8?B?oDE0MjUxIGVybGVkaWd0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Message-ID: DED191GryWtIIZS2TRq00000bbf@DED191.maximumasp.com
X-OriginalArrivalTime: 07 Dec 2011 18:48:06.0771 (UTC) FILETIME=[C21D5C30:01CCB510]
Date: 7 Dec 2011 13:48:06 -0500
X-Truedomain-Domain: supertext.ch
X-Truedomain-SPF: No Record
X-Truedomain-DKIM: No Signature
X-Truedomain-ID: AEF78022E2B2634AB2E00D8ED0F85BF5
X-Truedomain: Neutral

And this is my code:

Aspose.Email.Mail.MailMessage msg = new Aspose.Email.Mail.MailMessage();

msg.From = new Aspose.Email.Mail.MailAddress(fromEmail, fromName);

msg.To.Add(new Aspose.Email.Mail.MailAddress(toEmail, toName));

msg.Subject = Subject;
msg.SubjectEncoding = System.Text.Encoding.UTF8;

msg.TextBody = Message;
msg.BodyEncoding = System.Text.Encoding.UTF8;

Aspose.Email.Mail.SmtpClient client;
client = new Aspose.Email.Mail.SmtpClient(settings.Host);
client.DeliveryMethod = Aspose.Email.Mail.SmtpDeliveryMethod.Network;
client.AuthenticationMethod = Aspose.Email.Mail.SmtpAuthentication.None;
client.Send(msg);

We couldn’t find a pattern when this happens. Other messages with “Umlauts” work. Also longer subjects work too. Any idea?
We are using Version 1.1.0.0 on a Windows 2008 R2 Server.

Cheers

Remy

Hi Remy,


Apologies for your inconvenience.

I am trying to replicate your said issue with Aspose.Email for .NET v1.2.0 but so far I haven’t succeeded. I am using the same source code as provided by you to create the message and send the it to myself via gmail smtp. Then I receive the message on Outlook 2010 and it looks just fine.

Does this issue occur only on iPhone and MAC platforms? Can you please give a try to the latest version (link shared above) and let us know of your results.

Thank you

Yes, this only happens on the iPhone and on Mac Mail. Will try the new version and let you know.

Hi,


We have tested your scenario with iPhone and we are unable to replicate your said issue by using Aspose.Email for .NET v1.1.0. Soon we will get back to you with our results on MAC platform.

Meanwhile, can you please share your scenario in more detail and provide us any pre-processing steps if involved.

Looking forward to hear from you.

We rolled 1.2 out to our Dev Environement and currently I cannot reproduce the issue either. We will release it to Production and see if it stays like that.


Thanks for the quick reply and sorry if I wrote you too quickly.

Hey Aspose

We actually had another case today in Production with the new 1.2 Version.

Subject:
Cornelia Buttmann-Scholl hat Direct Mailing 14328 erledigt

to:
remy@supertext.ch (Supertext)

from:
info@supertext.ch (Supertext)

Message:
Korrekturlesen

Changing the message and the names did not change the result, but changing the subject to:
XCornelia Buttmann-Scholl hat Direct Mailing 14328 erledigt

solved it.

Hi,


Thank you for your feedback.

We are trying to replicate your said issue on iPhone and MAC OS but so far we haven’t succeeded. If you find any recurrence pattern, please let us know.

Regards,

I’ve attached some example code. Button2_Click reproduces the issue on my side.


We have Windows Server 2008 RS with IIS 7.
We are using the internal IIS mailserver to send these mails.

It’s an ASP.NET 4.0 application running in integrated mode. Everything should be UTF-8.

What other information could help?

Hi,


Thank you for your help.

I am able to reproduce the said issue on iPhone. So I have logged it in our bug tracking system under ticket id 32659 for the sake of correction.

We will soon figure this out and will let you know as soon as possible.

Regards,

Ok, thanks a lot.

Hi Remy,


We regret to inform you that the subject encoding problem logged earlier under ticket Id NETWORKNET-32659, is not caused by Aspose.Email for .NET component. In our investigation, we have found that the symbol “” is the part of message subject before it is sent to any recipient. Please check the snapshot attached for your reference. Its a binary view of MailTest.aspx.cs file shared by you. You can see that the symbol “” is appended with the words “Cornalia” and “Mailing”.

Please verify this on your end and let us know of your feedback on this.

Thank you.

Thanks for your research. Sounds feasible. Unfortunately, in my HexEditor I cannot see these signs. Could it be an issue with the File Encoding?

I opened the file with FlexHex. But in any case, I have no idea where this could come from…

Hi Remy,


As I have shared a snapshot showing these characters in your provided source code file. I believe these characters got pasted when you copied the string for the message subject in your source code file. For further investigation, you may check the origin of the Subject string.

Please do share your investigation results with us.
Thanks

Yes, I understand.

But I cannot find those characters on my side with my Hex tool, that is why I asked what tool you are using, so I can try to find the place where these characters are coming from. I assume it’s some UTF - ANSI mismatch somewhere.

Hi Remy,


We have used Total Commander Lister (in hex mode). Alternatively, you may use AraxisMerge. Please don’t forget to select “View-AsBinary” when using AraxisMerge.

Regards,