procedure TForm1.Button1Click(Sender: TObject);
var
filename: string;
begin //发送邮件主函数
try
IdSSLIOHandlerSocket1.SSLOptions.Method:=sslvSSLv3;
IdSMTP1.IOHandler:= IdSSLIOHandlerSocket1;
IdSMTP1.AuthenticationType:=atLogin;
IdSMTP1.Username:='eastern_2008@163.com';
IdSMTP1.Password:='cxtest';
IdSMTP1.Host:='smtp.exmail.163.com';
IdSMTP1.Port:=25;
if not idsmtp1.Connected then
begin
IdSMTP1.Connect(2000); //此处报错
end;
except
Showmessage('连接失败,请重试!');
Exit;
end;
IdMessage1.ContentType:= 'text/html';
IdMessage1.Body.Clear;
IdMessage1.Subject:='Delphi邮件发送测试'+datetimetostr(now);
IdMessage1.Body.Text:=memo1.Text;
IdMessage1.From.Address:= 'eastern_2008@163.com';
IdMessage1.From.Name := '大族监控系统';
IdMessage1.Recipients.EMailAddresses:= 'eastern_2008@163.com';
IdMessage1.Priority:=mpHighest; //邮件重要性
idSMTP1.Authenticate;
idSMTP1.Send(IdMessage1);
end;
正确答案:
IdSSLIOHandlerSocket1.SSLOptions.Method:=sslvSSLv23;
smtp.exmail.163.com
email不是exmail吧
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。