S
singer
Unregistered / Unconfirmed
GUEST, unregistred user!
大家请看这段代码,为什么老发不出去呢???(邮件发送失败),问题出现在哪呢??
procedure TForm1.Button1Click(Sender: TObject);
begin
idMessage.Body.Clear;
idMessage.Body.Add('mail test ');
idMessage.From.Address := '00@163.com';
idMessage.Recipients.EMailAddresses := 'cilygege@163.com';
idMessage.Subject := 'test';
idSMTP.Authen
ticationType := atLogin;
idSMTP.Username := 'cilygege@163.com';
idSMTP.Password := 'xingxing';
idSMTP.Host :='smtp.t163.com';
idSMTP.Port := 25;
try
idSMTP.Connect(-1);
idSMTP.Send(idMessage);
idSMTP.DisconnectSocket;
idSMTP.Disconnect;
idSMTP.Destroy;
showmessage('send mail ok');
except
idSMTP.Destroy;
idMessage.Destroy;
showmessage('mail send false');
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
idMessage.Body.Clear;
idMessage.Body.Add('mail test ');
idMessage.From.Address := '00@163.com';
idMessage.Recipients.EMailAddresses := 'cilygege@163.com';
idMessage.Subject := 'test';
idSMTP.Authen
ticationType := atLogin;
idSMTP.Username := 'cilygege@163.com';
idSMTP.Password := 'xingxing';
idSMTP.Host :='smtp.t163.com';
idSMTP.Port := 25;
try
idSMTP.Connect(-1);
idSMTP.Send(idMessage);
idSMTP.DisconnectSocket;
idSMTP.Disconnect;
idSMTP.Destroy;
showmessage('send mail ok');
except
idSMTP.Destroy;
idMessage.Destroy;
showmessage('mail send false');
end;
end;