Thema: Delphi Indy Html-Emails

Einzelnen Beitrag anzeigen

horst

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

Indy Html-Emails

  Alt 16. Nov 2003, 20:49
ich bekomme keine html-emails versendet, please help ...

sendNewsLetter(an, Listbox1.items, memo1.Lines, 'test@www.de', 'Test', 'mpnormal', 'text/html', 'mail.server.de', 'viuser', 'passwort', 25, 0);

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;
  // ContentTyp := 'text/html' ;
    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;
[edit=r_kerber]In Delphi-Tags geändert! Mfg, r_kerber[/edit]
  Mit Zitat antworten Zitat