Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Indy Mail-Client 9 - Probleme mit unters. Windows Versionen (https://www.delphipraxis.net/57914-indy-mail-client-9-probleme-mit-unters-windows-versionen.html)

sminds 28. Nov 2005 17:11


Indy Mail-Client 9 - Probleme mit unters. Windows Versionen
 
Ich habe einen Mail-Client in meine Software eingebunden; ich habe auf Rechner mit Windows XP und 98 getestet; auf XP läuft es ohne Probleme; unter Windows 98 gibt es häufig die Fehlermeldung: 5.5.4 Invalid Address; hatte von Euch schon jemand diese Fehlermeldung? Benutze Delphi 7 Enterprise mit Indy 9.00.10.

Hier der Kode:

von:='test@test.com';
an:='a@test.com;b@test.com'; // werden immer mehr als eine Adresse benutzt
betreff:='HALLO';
info:='asdfdsf';
attachment:='c:\test.txt';

Delphi-Quellcode:
function mailsenden(von:string;an:string;betreff:string;info:string;attachment:string):boolean;
var ok:boolean;
begin
  idmessage.MessageParts.Clear;
  with IdMessage do
  begin
    Body.Clear;
    Body.Add(info);
    from.Text:=von;
    replyto.EMailAddresses:=from.text;
    recipients.EMailAddresses:=an;
    subject:=betreff;
    priority:=tidmessagepriority(2);
    cclist.EMailAddresses:='';
    bcclist.EMailAddresses:='';
  end;

  IdSMTP.AuthenticationType:=atNone;
  IdSMTP.Username:='';
  IdSMTP.Password:='';

  IdSMTP.Host:='xxx.xxx.xxx.xxx'; // steht die IP-Adresse des Mailservers
  idsmtp.Port:=25;

  if attachment<>'' then
     TIdAttachment.Create(idmessage.MessageParts, attachment );

  idsmtp.Connect;
  ok:=false;
  try
    idsmtp.Send(idmessage);
    ok:=true;
  finally
    idsmtp.disconnect;
  end;
  mailsenden:=ok;
end;

lg,
~sminds


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:00 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