Einzelnen Beitrag anzeigen

horst

Registriert seit: 1. Jul 2003
347 Beiträge
 
Delphi 2007 Professional
 
#1

Keine Empfangsbestätigung + sendNewsLetter

  Alt 11. Nov 2003, 21:14
moin ...

ich hätte gleich zwei fragen zu dem sendNewsLetter script.
frage1: wenn ich darüber mails versende, will sich beim empfänger immer eine empfangsbestätigung versenden, welche stelle ist im script dafür verantwortlich, bzw. wie stelle ich das ab?

frage2: ich möchte, wenn alle mails versendet wurden (also die letzte mail raus ist)
einen timer einschalten, wo oder wie muss ich das tun?

freue mich über jeden tip!

Delphi-Quellcode:
procedure sendNewsLetter(an:Tstringlist; att,Text:Tstrings;
vonMail,Betreff,Priority,ContentTyp,SMTPServer,SMTPUsername,SMTPPass:String;
SMTPPort,SmtpAuthType:integer);

var IdMsgSend:TidMessage; SMTP:TidSmtp; i:integer; s:string;
begin
  IdMsgSend:=TidMessage.Create(nil);
  SMTP:=TidSmtp.Create(nil);
  with IdMsgSend do
  begin
    ContentType :=ContentTyp ;
    Body.Assign(Text);
    From.Text := vonMail;
    ReplyTo.EMailAddresses := vonMail;
    Subject := Betreff;
    Priority := Priority;
    s:='';
    for i:=0 to an.Count-1 do
    begin
      s:=s+BccList.EMailAddresses+an.Strings[i]+';
    end;
    BccList.EMailAddresses:=s;
    ReceiptRecipient.Text:=vonMail;
  end;

  if att.Count>=1 then
  begin
    for i:=0 to att.Count-1 do
    begin
      TIdAttachment.Create(IdMsgSend.MessageParts, att.Strings[i] );
    end;
  end;
  IdMsgSend.ContentType :=ContentTyp ;

  case SmtpAuthType of
    0: SMTP.AuthenticationType := atNone;
    1: SMTP.AuthenticationType := atLogin;
  end;
  SMTP.Username := SMTPUsername;
  SMTP.Password := SMTPPass;

  SMTP.Host := SMTPServer;
  SMTP.Port := SMTPPort;

  SMTP.Connect;
  try
    SMTP.Send(IdMsgSend);
  finally
    SMTP.Disconnect;
  end;
  IdMsgSend.free;
  SMTP.free;
end;
  Mit Zitat antworten Zitat