Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Running openSuSE 11.4 with Mono 2.10.6. I'm writing a C# library that (among other things) creates multipart MIME e-mails.
On the .NET Framework 2.0, it's possible to use this code:
MailMessage m = new MailMessage(ctor parameters);
AlternateView av = new AlternateView(ctor parameters);
av.ContentID = "some_uid";
...to produce mail headers like this in that particular part of the message:
On Mono, I'm able to set Content-Transfer-Encoding (using av.Transfer-Encoding) and Content-Type (through the constructor) and have them come out successfully in the headers. However, the Content-ID header isn't written out in the e-mail as it is on the MS Framework 2.0.
Created attachment 981 [details]
Possible patch to SmtpClient
The bug appears to be in System.Net.Mail.SmtpClient. There are several "StartSection" methods; the one used to send AlternateViews only passed in the Content-Type and Content-Transfer-Encoding fields. This fix works the same way as sending a LinkedResource does - the object gets passed in, and if a Content-ID has been specified, it is written out to the message.
Can't be 100% certain this works (don't have a build environment for Mono set up at the moment), but the SmtpClient class does at least compile cleanly.
The same issue was occuring with the Attachment class, not just AlternateView.
I've just submitted a pull request for this: https://github.com/mono/mono/pull/488
The pull request fixing this has been merged some time ago, can you try to reproduce this etc?
I'm pretty sure this issue can be closed, the fix was merged quite some time ago
Closing ancient bugs, please reopen if you're still having this problem.