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

Andreas Färber andreas.faerber at web.de
Wed Aug 30 06:28:56 EDT 2006


Am 29.08.2006 um 11:11 schrieb Vladimir Lushnikov:

> 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?

If you quoted correctly, then the newline after a MIME boundary and  
before the "Content-Type" is wrong; also after the last part the end  
is missing - should be "--", boundary name, "--".

Andreas

>
>
> 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
>
> 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
>
> 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...
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060830/3beaf1ba/attachment.html 


More information about the Mono-devel-list mailing list