procedure TForm1.FormCreate(Sender: TObject);
begin
try
IdSMTP1.AuthenticationType := atLogin;
IdSMTP1.Host := 'smtp.qq.com';
IdSMTP1.Username := 'test@qq.com'; //qq邮箱
IdSMTP1.Password := 'tjlhnnajvwrgbifca'; //授权码
IdSMTP1.Port := 25;
IdSMTP1.Connect(3000);
IdSMTP1.Authenticate; IdMessage1.Subject := '测试邮件';
IdMessage1.From.Address := 'test@qq.com';
IdMessage1.Recipients.EMailAddresses := 'test@foxmail.com';
IdMessage1.Body.Text := 'hello kkkkkkkkkkkkkk'; IdSMTP1.Send(IdMessage1);
except
on e: Exception do
ShowMessage(e.Message);
end;
end;
win10 + delphi 7测试ok,不用管SSL。
本文发表于2019-03-17 11:45:08