Ich wollte in ein Programm ein Mailclient integrieren. Leider habe ich damit wenig Erfolg. Ich versuche es z.Z. mit dem MailDemo, der bei
Indy dabei ist. Leider kommt immer, wenn ich eine E-Mail über
SMTP verschicken will:
authentication required
Bevor der Fehler kommt, fragt er immer noch zuerst nach
der "IdSMTP.pas", wobei man diese im
Indy-Installationsordner findet.
Die Einstellungen sind korrekt, aber ich gebe sie einmal trotzdem an:
Outgoing Server: mx.freenet.de
Port: 25
account: xxx
password: verratichnicht
(E-Mail-Addy:
xxx@yyy.zz)
To, Subject,
CC, BCC ausgefüllt.
Falls jemand nicht die IndyDemos hat:
Hier müsste irgendwo der Fehler liegen:
Delphi-Quellcode:
procedure TfrmMessageEditor.bbtnOkClick(Sender: TObject);
//click auf "send
begin
with IdMsgSend
do
begin
Body.Assign(Memo1.Lines);
From.Text := UserEmail;
ReplyTo.EMailAddresses := UserEmail;
Recipients.EMailAddresses := edtTo.Text;
{ To: header }
Subject := edtSubject.Text;
{ Subject: header }
Priority := TIdMessagePriority(cboPriority.ItemIndex);
{ Message Priority }
CCList.EMailAddresses := edtCC.Text;
{CC}
BccList.EMailAddresses := edtBCC.Text;
{BBC}
if chkReturnReciept.Checked
then
begin {We set the recipient to the From E-Mail address }
ReceiptRecipient.Text := From.Text;
end
else
begin {indicate that there is no receipt recipiant}
ReceiptRecipient.Text := '
';
end;
end;
{authentication settings}
case SmtpAuthType
of
0:
SMTP.AuthenticationType := atNone;
1:
SMTP.AuthenticationType := atLogin;
{Simple Login}
end;
SMTP.Username := SmtpServerUser;
SMTP.Password := SmtpServerPassword;
{General setup}
SMTP.Host := SmtpServerName;
SMTP.Port := SmtpServerPort;
{now we send the message}
SMTP.Connect;
try
SMTP.Send(IdMsgSend);
finally
SMTP.Disconnect;
end;
end;
*seufz*
MfG Phil