Archived Forum Post

Index of archived forum posts

Question:

Email using MailMan: Attachment in utf-8 send as ANSI.

Feb 14 '14 at 09:19

Hello,

I'm using MailMan to send an email with a file attachment that is encoded in utf-8 without BOM. I'm using the following code to send the email.

MailMan client = new MailMan();
//...Configure...
Email email = new Email();
email.FromAddress = fromAddress;
email.AddMultipleTo(recipients);
email.Subject = "Subject";
email.Charset = "utf-8";

//email.AddFileAttachment2(localErrorFileName, "text/csv; charset=utf-8");
email.AddFileAttachment(localErrorFileName);
email.SetAttachmentCharset(0, "utf-8");

client.SendEmail(email);

Just before sending the email, this email.GetMime() returns

MIME-Version: 1.0
Date: Wed, 05 Feb 2014 12:12:57 +0200
Message-ID: <BD589401EB168F47D52770C1C20B347442FA9146@ALFOKS>
Content-Type: multipart/mixed;
     boundary="------------060605050607070006040200"
X-Priority: 3 (Normal)
From: from@test.gr
CKX-Bounce-Address: from@test.gr
To: to@test.gr
Subject: Subject

--------------060605050607070006040200
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

--------------060605050607070006040200
Content-Type: text/csv; charset=utf-8;
     name="ShipmentRequestError20140205121257.csv"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
     filename="ShipmentRequestError20140205121257.csv"

=CE=91=CE=92=CE=93
--------------060605050607070006040200--

But when I see the email source from the email client (Thunderbird) I get this:

From - Wed Feb 05 12:13:31 2014
X-Account-Key: account2
X-UIDL: 1391595086.12155.qmail8,S=1275
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
Return-Path: <from@test.gr>
Delivered-To: to@test.gr
Received: (qmail 12128 invoked from network); 5 Feb 2014 10:11:26 -0000
Received: by simscan 1.4.0 ppid: 12055, pid: 12113, t: 0.1177s
         scanners: clamav: 0.97.8/m:55/d:18440
Received: from unknown (HELO alfoks) (from@test.gr@[...IP...])
          (Authenticated user: from@test.gr)
          (envelope-sender <from@test.gr>)
          by 0 (qmail-ldap-1.03) with SMTP
          for <to@test.gr>; 5 Feb 2014 10:11:26 -0000
MIME-Version: 1.0
Date: Wed, 05 Feb 2014 12:12:57 +0200
Message-ID: <680408340C8A3F0AF70C3141D5F394BE847B3A96@ALFOKS>
Content-Type: multipart/mixed;
     boundary="------------060605050607070006040200"
X-Priority: 3 (Normal)
From: from@test.gr
To: to@test.gr
Subject: Subject
X-EsetId: 093ECA3DDB7A0337527F92

--------------060605050607070006040200
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

--------------060605050607070006040200
Content-Type: text/csv; charset=utf-8;
     name="ShipmentRequestError20140205121257.csv"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
     filename="ShipmentRequestError20140205121257.csv"

=C1=C2=C3
--------------060605050607070006040200--

Notice the difference in the email attachment contents. Sent as utf-8, but received as ANSI. Am I missing something?


Accepted Answer

This is fixed in the latest v9.5.0 pre-release of Chilkat. Contact support@chilkatsoft.com if you need a pre-release download, and make sure to specify the exact build that is required: programming language, operating system, architecture, Visual Studio version (if applicable), .NET Framework version, etc.