控件
smtp: TIdSMTP;
MgeSend: TIdMessage;
代码
procedure TForm1.Button1Click(Sender: TObject);
begin
SMTP.Host:='smtp.163.com';
smtp.Username:='[email protected]';
smtp.Password:='paswrd';
smtp.Port:=25;
smtp.Connect();
MgeSend.Recipients.EMailAddresses:='[email protected]';
MgeSend.From.Text :='[email protected]';
MgeSend.Subject:='test';
MgeSend.Body.Text:='发邮件测试';
SMTP.Authenticate;
Smtp.Send(mgeSend);
end;
|
请发表评论