首页 > Linux操作系统 > Linux操作系统 > Delphi发email
控件
smtp: TIdSMTP;
MgeSend: TIdMessage;
代码
procedure TForm1.Button1Click(Sender: TObject);
begin
SMTP.Host:='smtp.163.com';
smtp.Username:='zhm001x@163.com';
smtp.Password:='paswrd';
smtp.Port:=25;
smtp.Connect(); idsmtp1.AuthenticationType:=atLogin;
MgeSend.Recipients.EMailAddresses:='zhm001x@qq.com';
MgeSend.From.Text :='zhm001x@163.com';
MgeSend.Subject:='test';
MgeSend.Body.Text:='发邮件测试';
SMTP.Authenticate;
Smtp.Send(mgeSend);
end;
==============================================
hehehha
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/93029/viewspace-1026519/ ,如需转载,请注明出处,否则将追究法律责任。