Article View: borland.public.cppbuilder.internet.socket
Article #1964Re: TIdAttachment Problem with MIME Encoding
From: Robert Lieblich
Date: Thu, 21 Sep 2006 18:32
Date: Thu, 21 Sep 2006 18:32
56 lines
3308 bytes
3308 bytes
Hi Remy,
> That is not what I wanted to see. Please show the COMPLETE message data,
> including all headers.
I don't think that this is neccessary.
> The ContentType alone has no effect whatsoever on Indy's encoders. They
> don't care about the ContentType at all. The value is written to the
> header
> inside the message data and then ignored for everything else.
That is a good hint. That means, the encoding in Indy should correct, the
additional bytes are added
from the receiving mailserver (because I was using the wrong ContentType,
ok).
> For any file, binary or text, you have to use the proper ContentType. For
> example, .txt files must use "text/plain", .htm files must use
> "text/html",
> .pdf must use "application/pdf", .zip files must use
> "application/x-zip-compressed", etc. So unless you know for sure off the
> top of your head what a given file should use, then you should always use
> Indy's GetMIMETypeFromFile() function instead, ie:
That's not bad, but actually, as Hans noted, it does not care about the file
itself.
And, sometimes I want to send binary files with a .txt extension(why not? If
it's just for me..).
But I did some tests and all that I really want is to send any attachment
unchanged (in
a binary mode). So, with "image/jpg" or "application/x-zip-compressed" I
could send all attachments I tried so far unchanged, and no additional
bytes.
And, could it be bad to transfer even a plain text attachment in this mode?
By the way, when you put the text message in a text-attachment like that:
...
TIdText *text1 = new TIdText(IdMessage1->MessageParts, NULL);
text1->Body->Add("Some text...");
text1->ContentType = "text/plain";
...
and not in the IdMessage1->Body, it's not possible to use UUEncoding (Indy
gives an errormessage that only a simple textmessage plus attachment are
allowed in UU-mode) .
And, in MIME mode, this text is ignored at the receiving mailserver (or the
mailclient?), at least
at our company Exchangeserver 2003 and the one from web.de (which is
according to the MIME
standard as far as I understand). But in the form: text message in the
messagebody and
other files as attachements, it works also well.
Best regards Robert
Technical Details
Message-ID:
<4512da05@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45112258$1@newsgroups.borland.com> <45117004$1@newsgroups.borland.com> <45118fd7$1@newsgroups.borland.com> <4511bc98$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,edd2a3551c00f96a X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Robert Lieblich" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <45112258$1@newsgroups.borland.com> <45117004$1@newsgroups.borland.com> <45118fd7$1@newsgroups.borland.com> <4511bc98$1@newsgroups.borland.com> Subject: Re: TIdAttachment Problem with MIME Encoding Date: Thu, 21 Sep 2006 20:32:47 +0200 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 217.87.166.83 Message-ID: <4512da05@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1158863365 217.87.166.83 (21 Sep 2006 11:29:25 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail