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

Rafael Teixeira monoman at gmail.com
Wed Aug 30 14:45:18 EDT 2006


Hi Vladimir,

Can you give us more details about why are telling the headers go wild?

>From the little you show, the headers look normal for an email with
attachments. Such emails must be of the multipart variety, and each
attachment has it's own headers prepended to them and are separated
from each other by the "boundary" lines.

Some email clients send the original text in the main-block, but some
others do the "alternate" block, as the one your example shows.

So please be more specific, for instance: What email-client are you
trying to read the sent messages? Because it may be the email-client
who is failling to decode a valid message..., And so you can try to
use other email-clients (web like gmail or desktop like evolution) to
compare...

:)

On 8/29/06, Vladimir Lushnikov <vladimir.d.lushnikov at gmail.com> wrote:
> 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...
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>


-- 
Rafael "Monoman" Teixeira
---------------------------------------
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man." George Bernard Shaw


More information about the Mono-list mailing list