- 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
来源: http://www.bubuko.com/infodetail-2990246.html