[Mono-bugs] [Bug 621639] New: Sys.Net.Mail Unable to embed image and attach files in the same mail.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 12 12:03:17 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=621639

http://bugzilla.novell.com/show_bug.cgi?id=621639#c0


           Summary: Sys.Net.Mail Unable to embed image and attach files in
                    the same mail.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ghamrouni at iptech-offshore.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development
           Blocker: Yes


Description of Problem:

When we embed an image in a html mail, 
and then attach a file to this mail the 
mail sent doesn't render as specified.
It works fine on MS .Net

Steps to reproduce the problem:

MailMessage mail = new MailMessage();
mail.From = new MailAddress("me at mycompany.com");
mail.To.Add("you at yourcompany.com");

mail.Subject = "This is an email";
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is
my plain text content, viewable by those clients that don't support html",
null, "text/plain");

AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is
an embedded image.<img src=cid:companylogo>", null, "text/html");
LinkedResource logo = new LinkedResource( "c:\\temp\\logo.gif" );
logo.ContentId = "companylogo";
htmlView.LinkedResources.Add(logo);

mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);

//When we comment this line it works fine.
mail.Attachments.Add(new Attachment(attachedFile));

SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);


How often does this happen? 
Always

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list