[Mono-bugs] [Bug 80987][Nor] New - Bad mime-parts when composing mail with embedded images using System.net.mail
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Feb 28 13:25:36 EST 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by tpn at torsoft.dk.
http://bugzilla.ximian.com/show_bug.cgi?id=80987
--- shadow/80987 2007-02-28 13:25:36.000000000 -0500
+++ shadow/80987.tmp.24149 2007-02-28 13:25:36.000000000 -0500
@@ -0,0 +1,149 @@
+Bug#: 80987
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Red Hat 9.0
+OS Details:
+Status: NEW
+Resolution:
+Severity: 008 One day
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: tpn at torsoft.dk
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Bad mime-parts when composing mail with embedded images using System.net.mail
+
+Description of Problem:
+Multipart mails - ie. mails with a plain text part and a html-mimepart
+with embedded images - are not built correct. The resulting mail mime-
+parts differs between MS.NET and mono. In mono there is no image-mimepart
+at all.
+
+Steps to reproduce the problem:
+Run the following code:
+ public static void SendMail(string sFrom, string sTo, string sSubject,
+string sBodyHtml) {
+ string sBodyPlain = StripHTML(sBodyHtml);
+ MailMessage mail = new MailMessage(sFrom, sTo);
+ mail.Subject = sSubject;
+ mail.Body = sBodyPlain;
+
+ AlternateView altHtml = AlternateView.CreateAlternateViewFromString
+(sBodyHtmlBn, new System.Net.Mime.ContentType("text/html; charset=utf-
+8"));
+ LinkedResource linkLogo = new LinkedResource("filepath.gif", new
+System.Net.Mime.ContentType("image/gif"));
+ linkLogo.ContentId = "logo.gif";
+ altHtml.LinkedResources.Add(linkLogo);
+ mail.AlternateViews.Add(altHtml);
+
+ SmtpClient smtp = new SmtpClient(Config.GetString("SMTPserver"),
+(Int32)25);
+ smtp.Credentials = null;
+ smtp.Send(mail);
+ }
+
+
+
+Actual Results:
+Resulting mail with mono:
+
+...more headers...
+Subject: test using mono
+MIME-Version: 1.0
+Content-Type: multipart/mixed; charset=us-ascii; boundary=--
+boundary_0_0e345d62-9dca-4cf7-8fbc-e90b6a5390fb
+Message-Id: <20070228164019.0323EBF84 at site1.bolignet.dk>
+Date: Wed, 28 Feb 2007 17:40:19 +0100 (CET)
+X-Virus-Scanned: by amavisd-new at bolignet.dk
+
+test using monoMed Venlig Hilsenbolig:net
+
+
+----boundary_0_0e345d62-9dca-4cf7-8fbc-e90b6a5390fb
+content-type: multipart/alternative; charset=us-ascii; boundary=--
+boundary_1_45a4a1d6-0077-4b84-b02c-c10961d2a259
+
+----boundary_1_45a4a1d6-0077-4b84-b02c-c10961d2a259
+content-type: text/html; charset=utf-8
+content-transfer-encoding: base64
+
+PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9u
+YWwvL0VOIj48aHRtbD48aGVhZD48bGluayByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQv
+Y3NzIiBocmVmPSJtYWlsX3N0eWxlLmNzcyIgLz48L2hlYWQ+PGJvZHkgQkdDT0xPUj0iI0VF
+RUVFRSI+PHRhYmxlIEJHQ09MT1I9IiNGRkZGRkYiIGJvcmRlcj0iMSIgY2VsbHBhZGRpbmc9
+IjgiIGJvcmRlcmNvbG9yPSIjQ0NDQ0NDIiB3aWR0aD0iNDAwIj48dHI+PHRkPjxmb250IGZh
+Y2U9InZlcmRhbmEsIGFyaWFsIiBzaXplPSIyIj50ZXN0IHVzaW5nIG1vbm88YnI+PGJyPk1l
+ZCBWZW5saWcgSGlsc2VuPGJyPmJvbGlnOm5ldDwvYnI+PC9mb250Pjxicj48aW1nIHNyYz0i
+Y2lkOmJuX2xvZ28uZ2lmIj48L3RkPjwvdHI+PC90YWJsZT48L2JvZHk+PC9odG1sPg==
+
+
+----boundary_1_45a4a1d6-0077-4b84-b02c-c10961d2a259
+content-type: text/plain
+content-transfer-encoding: base64
+
+dGVzdCB1c2luZyBtb25vDQ1NZWQgVmVubGlnIEhpbHNlbg1ib2xpZzpuZXQ=
+
+
+----boundary_1_45a4a1d6-0077-4b84-b02c-c10961d2a259--
+
+----boundary_0_0e345d62-9dca-4cf7-8fbc-e90b6a5390fb--
+
+
+
+Expected Results:
+Resulting mail with MS:
+
+...more headers...
+mime-version: 1.0
+From: tpn at torsoft.dk
+To: tpn at torsoft.dk
+date: 28 Feb 2007 17:23:20 +0100
+subject: test using MS
+content-type: multipart/mixed; boundary=--boundary_3_4866e559-31e2-41fe-
+ab93-7451162e92c6
+Message-Id: <20070228162317.504C6BF84 at site1.bolignet.dk>
+X-Virus-Scanned: by amavisd-new at bolignet.dk
+
+
+----boundary_3_4866e559-31e2-41fe-ab93-7451162e92c6
+content-type: multipart/alternative; boundary=--boundary_4_62b859e2-4dfc-
+4fd5-a373-fac3c3261319
+
+
+----boundary_4_62b859e2-4dfc-4fd5-a373-fac3c3261319
+content-type: text/plain; charset=us-ascii
+content-transfer-encoding: quoted-printable
+
+test using MS=0D=0DMed Venlig Hilsen=0Dbolig:net
+----boundary_4_62b859e2-4dfc-4fd5-a373-fac3c3261319
+content-type: multipart/related;
+ boundary=--boundary_5_78bb3272-57a4-4ab1-bad9-3c69eb6aff75;
+type="text/html"
+
+
+----boundary_5_78bb3272-57a4-4ab1-bad9-3c69eb6aff75
+content-type: text/html; charset=utf-8
+content-transfer-encoding: base64
+
+[base 64 html-part]
+----boundary_5_78bb3272-57a4-4ab1-bad9-3c69eb6aff75
+content-type: image/gif
+content-transfer-encoding: base64
+content-id: <bn_logo.gif>
+
+[base 64 embedded logo-part]
+----boundary_5_78bb3272-57a4-4ab1-bad9-3c69eb6aff75--
+
+----boundary_4_62b859e2-4dfc-4fd5-a373-fac3c3261319--
+
+----boundary_3_4866e559-31e2-41fe-ab93-7451162e92c6--
+
+How often does this happen?
+Every time
+
+
+Additional Information:
More information about the mono-bugs
mailing list