Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   smtp cc/bbc? (https://www.delphipraxis.net/191606-smtp-cc-bbc.html)

akio87 1. Feb 2017 13:29

smtp cc/bbc?
 
Hallo,

ich hoffe, ihr könnt mir hier weiterhelfen.

Aktuell sende die mails über einen smtp server und möchte nun die Funktion cc/bcc Funktion mit einbauen.

Das einfache senden funktioniert, nur leider weiß ich nicht, wie ich die cc/bcc Funktion einsetzen kann?

Hat jemand eine Idee, wie das bei dem nachfolgenden Code aussieht, wie das dort einzubinden ist?

Ich nutze aktuell folgenden Code:

Delphi-Quellcode:
procedure TfmWarenKorb.SendEmail1(const Recipients: string; const CCList: string; const Subject: string; const Body: string; Att: Boolean; Filename:String);
var
  SMTP: TIdSMTP;
  Email: TIdMessage;
  SSLHandler: TIdSSLIOHandlerSocketOpenSSL;
  Attachment: TIdAttachment;
  I: Integer;
begin
  SMTP := TIdSMTP.Create(nil);
  Email := TIdMessage.Create(nil);
  SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  SMTP.IOHandler:= SSLHandler;


  try
    SMTP.AuthType := satNone;
    SMTP.Host := Server;//'smtp.gmail.com';
    SMTP.Port := Port;// 587;

    if Att = true then
      Attachment := TIdAttachmentFile.Create(Email.MessageParts, Filename);

    Email.From.Address := emailfrom;
    Email.Recipients.EmailAddresses := Recipients;
    Email.Subject := Subject;
    Email.Body.Text := Body;
    //Email.CCList.EMailAddresses := CCList;
    Email.ReplyTo.EMailAddresses := 'Mailadresse';


    SMTP.Connect;
    SMTP.Send(Email);
    SMTP.Disconnect;

  finally
    if Att = true then Attachment.Free;
    SMTP.Free;
    Email.Free;
    SSLHandler.Free;
  end;
end;

Klaus01 1. Feb 2017 13:38

AW: smtp cc/bbc?
 
.. gibt es eine email.bcclist ?

Grüße
Klaus

akio87 1. Feb 2017 15:50

AW: smtp cc/bbc?
 
Hallo,

das ist mir jetzt peinlich...

Das muss ich komplett übersehen haben... Ja gibt es und es funktioniert..

Vielen Dank für die schnelle Unterstützung :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz