chmichael 12 Posted September 15 Hello, I get a "attachment.asm" or (.htm if it's html) in the e-mail ICS 9.3 SVN sends. Any ideas ? Thank you Share this post Link to post
Angus Robertson 574 Posted September 16 Sorry, you'll need to explain what you are doing with which component. Angus Share this post Link to post
chmichael 12 Posted September 16 Hello, Here's the function which i send the e-mails function SendEMail(const AArgs: TArray<String>): String; var FSMTP: TSSLSmtpCli; begin FSMTP := TSSLSmtpCli.Create(nil); FSMTP.SslContext := TSslContext.Create(nil); FSMTP.SslContext.SslMinVersion := sslVerTLS1_2; with FSMTP do begin Host := 'my.emailserver.com'; Port := '587'; Username := 'myuser@emailserver.com'; Password := 'mypassword'; AuthType := smtpAuthAutoSelect; ContentType := smtpHtml; // Important !!! Set it First //Allow8bitChars := False; //ConvertToCharset := True; CharSet := 'UTF-8'; HdrFrom := 'myuser@emailserver.com'; HdrTo := 'myuser@emailserver.com'; RcptName.Text := HdrTo; HdrSubject := UTF8Encode(VarToStr(AArgs[0])); if Length(AArgs) > 1 then MailMessage.Text := UTF8Encode(VarToStr(AArgs[2])); OpenSync; MailSync; Result := ErrorMessage; FreeAndNil(FSMTP.SslContext); FreeAndNil(FSMTP); end; end; Using the v9.3 SVN version the e-mail which it sends adds an extra attachment which v9.1 didn't: (either plaintext either html) Share this post Link to post
Angus Robertson 574 Posted September 16 There have been no changes to TSSLSmtpCli since V9.0, except to build with other units. I'd make sure whatever properties are used for attachments are cleared, sorry, don't know which off hand. Angus Share this post Link to post
chmichael 12 Posted September 16 (edited) I think the error is header for whatever reason it's not the correct eg: v9.1: Content-Transfer-Encoding: quoted-printable v9.3: Content-Transfer-Encoding: q Seems 9.3 doesn't apply the correct header values Also Return-Path: <> is empty (in both v9.1 and v9.3) Edited September 16 by chmichael Share this post Link to post
Angus Robertson 574 Posted September 16 The line: FEmailBody.Add('Content-Transfer-Encoding: quoted-printable') {AG} is unchanged in 15 years. But I will test the sample to make sure it works, in a few days time. Angus 1 Share this post Link to post
Angus Robertson 574 Posted September 24 I've just tested the OverbyteIcsSslMailSnd sample in V9,3 and it's sending content and attached files as expected with the correct encoding headings. But it is not attempting to send HTML emails. BTW, the component expects String content and will convert to whatever encoding is specified, no idea what will happen if you encode UTF8 and it then encodes it again. Angus Angus Share this post Link to post
Lajos Juhász 292 Posted September 25 15 hours ago, Angus Robertson said: BTW, the component expects String content and will convert to whatever encoding is specified, no idea what will happen if you encode UTF8 and it then encodes it again. Depends on the version of the Delphi. Code Page aware versions of Delphi is going to do as expected UTF-16 to UTF-8 and on assignment back from UTF-8 into UTF-16. Share this post Link to post
chmichael 12 Posted September 27 On 9/24/2024 at 6:49 PM, Angus Robertson said: I've just tested the OverbyteIcsSslMailSnd sample in V9,3 and it's sending content and attached files as expected with the correct encoding headings. But it is not attempting to send HTML emails. BTW, the component expects String content and will convert to whatever encoding is specified, no idea what will happen if you encode UTF8 and it then encodes it again. Angus Angus I'll take a deeply look when i find some time Share this post Link to post