sorry, damned shortcut ...

Yes all part is great, only subject is wrong.
I have code
 Msg := Tmimemess.Create;
 part := msg.AddPartMultipart('mixed',nil);
 msg.header.subject := s;
 msg.header.from := mFrom;
 msg.AddPartText(mMSG,part);
 msg.EncodeMessage;

message is coding good, bud subject is not coding....
if i send mail to gmail output display good, but OE display wrong chars.

In mail body is "Subject: 123456789+ěščřžýáíé" (it identic as s variable)


From: nore...@bsoftware.biz
To: j...@baudys.name
Subject: 123456789+ěščřžýáíé
Date: Wed, 2 Nov 2011 16:42:40 +0100
MIME-Version: 1.0 (produced by Synapse)
X-mailer: SendMailCommandLine 0.0.1b
 (http://www.bsoftware.biz/sendmailcommandline/)
Keywords: www.BSoftware.biz, sendmailcmdline, sendmailinifile
Content-type: Multipart/mixed; boundary="08857A78_217EC7B3_Synapse_boundary"
Content-Description: Multipart message

Than you

Jiri Baudys

On Wed, Nov 2, 2011 at 4:29 PM, Jiří Baudyš <bau...@bsoftware.biz> wrote:
> Yes all part is great, only subject is wrong.
> I have code
>
> Msg := Tmimemess.Create;
>     L := TStringList.create;
>     try
>      //AssignFile(f,WorkDirectory + mStatusFile);
>      //Rewrite(f);
>      tmc.WriteInfo('Mail generate begin',itInformation,vlInformation);
>      tmc.MailStatus := tmc.MailStatus + '+mail_begin';
>      tmc.BeginProcess;
>     // msg.header.CharsetCode := ISO_8859_2;
>      part := msg.AddPartMultipart('mixed',nil);
>      //s:= CharsetConversion(msubject,CP1250,ISO_8859_2);
>      s :=  EncodeTriplet(mSubject, '=', SpecialChar + NonAsciiChar + 
> CzechChar);
>      s:=  s + #0;
> //     Msg.Header.EncodeHeaders();
>      //c := IdealCharsetCoding(s, UTF_8, IdealCharsets);
>      //s := InlineEncode(s, UTF_8, c);
>      msg.header.subject := s;
>      msg.header.from := mFrom;
>      msg.header.tolist.add(mto);
>      if mcc <> '' then msg.Header.CCList.add(mcc);
>      msg.Header.CustomHeaders.Add('Keywords: www.BSoftware.biz,
> sendmailcmdline, sendmailinifile');
>      msg.Header.XMailer := appName + ' (' + appHome + ')' ;
>      msg.AddPartText(mMSG,part);
>      for fo := 0 to mfiles.Count-1 do
>        begin
>         s := copy(mfiles[fo],0,pos('=',mfiles[fo])-1);
>         t := copy(mfiles[fo],pos('=',mfiles[fo])+1,255);
>         tmc.WriteInfo('Mail add attachement. (' + s +
> ')',itInformation,vlDebug);
> //        msg.AddPartBinaryFromFile('mfile.',part);
>        tmp := TMemoryStream.Create;
>         try
>           tmp.LoadFromFile(t);
>           Msg.AddPartBinary(tmp, s, part);
>         finally
>           tmp.Free;
>         end;
>        end;
> //     Msg.Header.EncodeHeaders();
>      tmc.WriteInfo('Mail encode',itInformation,vlDebug);
>      msg.EncodeMessage;
>
>
> On Wed, Nov 2, 2011 at 12:08 PM, Lukas Gebauer <gebyl...@mlp.cz> wrote:
>>
>> > please help me with charset coding mail subject.
>> > How i use in subject "czech" charset ??
>>
>> And what is your problem?
>>
>> Use TMimeMess class for build message. It have subject property as
>> ansistring, and Synapse do all encoding be self. You not need to do any
>> special handling. (In case of Czech, Ansistring is CP1250, synapse recode
>> it to ISO-8859-2 and encode it to RAW mail message.)
>>
>> It is because I am lazy Czech programmer. ;-)
>>
>>
>>
>> --
>> Lukas Gebauer.
>>
>> http://synapse.ararat.cz/ - Synapse Delphi and Kylix TCP/IP Library
>> http://geoget.ararat.cz/ - Geocaching solution
>>
>>
>>
>> ------------------------------------------------------------------------------
>> RSA&#174; Conference 2012
>> Save $700 by Nov 18
>> Register now&#33;
>> http://p.sf.net/sfu/rsa-sfdev2dev1
>> _______________________________________________
>> synalist-public mailing list
>> synalist-public@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/synalist-public
>

------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to