[Mono-bugs] [Bug 76972][Wis] New - System.Net.Mail.MailMessage problem

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Dec 12 23:28:01 EST 2005


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 awaddell at fnfr.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76972

--- shadow/76972	2005-12-12 23:28:01.000000000 -0500
+++ shadow/76972.tmp.6297	2005-12-12 23:28:01.000000000 -0500
@@ -0,0 +1,116 @@
+Bug#: 76972
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: any
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: awaddell at fnfr.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Net.Mail.MailMessage problem 
+
+Description of Problem:
+MailMessage defaults Content-Type to be "application/octet-stream" where as
+.NET defaults to "text/plain"
+
+
+Steps to reproduce the problem:
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net.Mail;
+using System.Net;
+
+namespace ffmail
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+
+            MailAddress from = new MailAddress("foo at bar.com", "ffmail");
+            MailAddress to = new MailAddress("awaddell at fnfr.com");
+            MailMessage msg = new MailMessage(from, to);
+
+            msg.Subject = "test subject";
+            msg.Body = "test body";
+
+            SmtpClient mailClient = new SmtpClient("smtp.fnfr.com", 25);
+            mailClient.Send(msg);
+        }
+    }
+}
+
+This program produces the following two SMTP packets when run on my machine:
+
+Run on .NET
+
+No.     Time        Source                Destination           Protocol Info
+     13 0.004607    10.155.0.95           10.155.0.15           SMTP    
+Message Body
+
+Frame 13 (272 bytes on wire, 272 bytes captured)
+Ethernet II, Src: 00:13:20:02:43:a1, Dst: 00:0f:1f:6a:b8:99
+Internet Protocol, Src Addr: 10.155.0.95 (10.155.0.95), Dst Addr:
+10.155.0.15 (10.155.0.15)
+Transmission Control Protocol, Src Port: 3207 (3207), Dst Port: smtp (25),
+Seq: 75, Ack: 536, Len: 218
+Simple Mail Transfer Protocol
+    Message: mime-version: 1.0\r\n
+    Message: from: ffmail <foo at bar.com>\r\n
+    Message: to: awaddell at fnfr.com\r\n
+    Message: date: 12 Dec 2005 19:18:33 -0800\r\n
+    Message: subject: test subject\r\n
+    Message: content-type: text/plain; charset=us-ascii\r\n
+    Message: content-transfer-encoding: quoted-printable\r\n
+    Message: \r\n
+
+Run on Mono:
+
+No.     Time        Source                Destination           Protocol Info
+     35 8.230881    10.155.0.95           10.155.0.15           SMTP    
+Message Body
+
+Frame 35 (177 bytes on wire, 177 bytes captured)
+Ethernet II, Src: 00:13:20:02:43:a1, Dst: 00:0f:1f:6a:b8:99
+Internet Protocol, Src Addr: 10.155.0.95 (10.155.0.95), Dst Addr:
+10.155.0.15 (10.155.0.15)
+Transmission Control Protocol, Src Port: 3209 (3209), Dst Port: smtp (25),
+Seq: 101, Ack: 271, Len: 123
+Simple Mail Transfer Protocol
+    Message: To: <awaddell at fnfr.com>\r\n
+    Message: Subject: test subject\r\n
+    Message: MIME-Version: 1.0\r\n
+    Message: Content-Type: application/octet-stream\r\n
+    Message: \r\n
+    Message: test body\r\n
+    Message: .\r\n
+
+
+
+This results in the mail body arrive as an ugly .dat attachement.
+
+1. 
+2. 
+3. 
+
+Actual Results:
+see packet dump above
+
+Expected Results:
+same behavior as .NET
+
+
+How often does this happen? 
+
+
+Additional Information:


More information about the mono-bugs mailing list