I'm on Delphi 2007, Indy version 10.6.1.5188.
When I send messages using my regular SMTP server and TIdSMTP
, everything works fine.
But when I send using Amazon Simple Email Service SMTP (SES), all special chars in msg body, like á
, ç
, é
are replaced for strange symbols like ¿½
and �
.
What should I do to fix this issue, and why is it happening only when I use SES?
Here is my current code :
idsmtp1.Host := 'email-smtp.us-west-2.amazonaws.com';
idsmtp1.username := 'myusername';
idsmtp1.password := 'mypassword';
idsmtp1.Port := 587;
idsmtp1.IOHandler := IdServerIOHandlerSSLOpenSSL1;
idsmtp1.usetls := utUseExplicitTLS;
idsmtp1.UseEhlo := true;
idmessage1.body.text := 'This is a test é á ó ç';
with IdServerIOHandlerSSLOpenSSL1 do
begin
SSLOptions.Method := sslvTLSv1;
SSLOptions.VerifyMode := [];
SSLOptions.VerifyDepth := 0;
end;
idsmtp1.Connect;
idsmtp1.Send(idmessage1);
And here is TIDMessage.savetofile contents :
From: "My Company" <myemail@mydomain.com>
Subject: Your subject
To: xxxx@hotmail.com.br
Bcc: myotheremail@mydomain.com
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Sender: My Company <myemail@mydomain.com>
Organization: My Organization
Date: Mon, 18 Nov 2019 09:19:05 -0300
VGhpcyBpcyBhIHRlc3Qgw6kgw6Egw7Mgw6cNCg==
.