[Mono-list] Help with garbled email headers when adding attachment

Vladimir Lushnikov vladimir.d.lushnikov at gmail.com
Tue Aug 29 05:11:09 EDT 2006


Hi,

I have looked at trunk implementation and it seems that it's marked as a
todo item. However, it has been marked over 5 months as that, so re-sending
to mono-devel.

If I knew the standard I would be happy to implement the functionality in
mono, but I wouldn't be using the classes if I did that. Could someone help
me out please?

Thank you,
Vladimir Lushnikov

On 8/28/06, Vladimir Lushnikov <vladimir.d.lushnikov at gmail.com> wrote:
>
> Hi,
>
> I'm trying to send an email with mono using smtp.
>
> If I send one normally, I get the following:
>
> ---
>
> Subject: Mail test
> MIME-Version: 1.0
> Content-Type: text/html; charset=us-ascii
>
>
> Message-Id: <.....>
> Date: Mon, 28 Aug 2006 15:33:16 -0700 (PDT)
>
> This is a mail test
> <br />This is a newline
>
> ---
>
> However, as soon as I add an attachment, headers go wild:
> ---
>
> Subject: Hotbackup r22
> MIME-Version: 1.0
> Content-Type: multipart/mixed; charset=us-ascii; boundary=--boundary_0_6ab9cc28-7330-47d7-ad54-569f53fe2014
> Message-Id: <.....>
> Date: Mon, 28 Aug 2006 15:43:44 -0700 (PDT)
>
>
> ----boundary_0_6ab9cc28-7330-47d7-ad54-569f53fe2014
> content-type: multipart/alternative
> content-transfer-encoding: quoted-printable
>
> This is a mail test
> <br />This is a newline
> ----boundary_0_6ab9cc28-7330-47d7-ad54-569f53fe2014
>
> content-type: multipart/alternative
> content-transfer-encoding: base64
>
> SGVsbG8sIHdvcmxkLi4uCg==
>
> ---
>
> My code is:
>       // Create  the file attachment for this e-mail message.
>                 Attachment data = new Attachment(file.FullName,
> MediaTypeNames.Application.Octet);
>                 // Add time stamp information for the file.
>                 ContentDisposition disposition = data.ContentDisposition;
>                 disposition.CreationDate = File.GetCreationTime(
> file.FullName );
>                 disposition.ModificationDate = File.GetLastWriteTime(
> file.FullName);
>                 disposition.ReadDate = File.GetLastAccessTime(
> file.FullName);
>                 mail.Attachments.Add(data);
>
> Where mail is MailMessage object, file is a FileInfo object. I am using
> gmcs and trunk build (from yesterday).
>
> All help would be appreciated.
>
> Regards,
> Vladimir Lushnikov
>
> --
> Vladimir "Vlad#" Lushnikov
> http://www.vladsharp.com - The Crests of Reason - Journey to a better
> object...
>



-- 
Vladimir "Vlad#" Lushnikov
http://www.vladsharp.com - The Crests of Reason - Journey to a better
object...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060829/bc2c6920/attachment.html 


More information about the Mono-list mailing list