IdSMTP1.Host := Host_Server_SMTP;
IdSMTP1.Port := Port_Server_SMTP;
IdSMTP1.Username := SenderUserName;
IdSMTP1.Password := SenderPassword;
IdMessage1.From.Address := SenderAddress;
IdMessage1.From.Name := 'Отчет за неделю';
IdMessage1.Subject := ExtractFileName(FileNameAttach);
IdMessage1.Body.Text := 'Здравствуйте. ';
IdMessage1.ContentType := 'text/plain; charset=UTF-16';
IdMessage1.Recipients.Add;
IdMessage1.Recipients.Items[0].Text := RecipientAddress;
TIdAttachmentFile.Create(IdMessage1.MessageParts, FileNameAttach);
Строчкой
IdMessage1.ContentType := 'text/plain; charset=UTF-16';не отделаться.
С ней слова
Отчет за неделюпревращаются в иероглифы. А цель - чтоб
IdMessage1.Body.Text выглядело кириллицей.
Как сделать, чтоб тело письма по-русски?
CharSet is a String property that indicates the character set expected in message contents. CharSet can contains one of the official names for character sets as identified in IdCharsetNames.
Character set information may also be supplied as an argument in the content type for individual items in the MessageParts collection. The value in CharSet will be updated using
the content type argument value when message properties are read in ProcessHeaders.
Declaration
property MessageParts: TIdMessageParts;
Summary
List of message parts for the message.
Description
MessageParts is a TIdMessagePartsList used to store the TIdMessagePart components that make up the message. MessageParts can contain two TIdMessagePart descendants:
TIdText and TIdAttachment.
MessageParts is used when IsEncoded is set to True (on sending), or NoDecode is set to false for receiving.
Delphi XE