IdSMTP1.Host := '163.com';
IdSMTP1.Port := 25;
IdSMTP1.AuthenticationType := atLogin;
IdSMTP1.Username := '*****'; //邮箱账号
IdSMTP1.Password := '*****'; //邮箱密码 with IdMessage1 do
begin
//Body.Assign('Memo1.Lines');
Body.Text := ('姓名:'+suiEdit4.Text+ #13 +'联糸方法:'+ suiEdit3.Text+ #13 + suiMemo1.Lines.Text); //邮件正文
From.Text := '[email protected]'; //发件人地址
Recipients.EMailAddresses := '[email protected]'; //收件人地址 Subject := '客户反映(号码查询软件)'+DateTimeToStr(now()); //邮件主题
end; try
if not IdSMTP1.Connected then
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
MessageBox(0, '发送成功', '提示', MB_OK + MB_ICONINFORMATION); finally
if IdSMTP1.Connected then
IdSMTP1.Disconnect;
end;
except
application.MessageBox('邮件地址不正确,或代理设置出错,或登陆名称与口令不正确。', '错误', MB_OK + MB_ICONERROR);
//continue;
end;
以上代码,我用公司的服务又得!实在不解~~~
IdSMTP1.Port := 25;
IdSMTP1.AuthenticationType := atLogin;
IdSMTP1.Username := '*****'; //邮箱账号
IdSMTP1.Password := '*****'; //邮箱密码 with IdMessage1 do
begin
//Body.Assign('Memo1.Lines');
Body.Text := ('姓名:'+suiEdit4.Text+ #13 +'联糸方法:'+ suiEdit3.Text+ #13 + suiMemo1.Lines.Text); //邮件正文
From.Text := '[email protected]'; //发件人地址
Recipients.EMailAddresses := '[email protected]'; //收件人地址 Subject := '客户反映(号码查询软件)'+DateTimeToStr(now()); //邮件主题
end; try
if not IdSMTP1.Connected then
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
MessageBox(0, '发送成功', '提示', MB_OK + MB_ICONINFORMATION); finally
if IdSMTP1.Connected then
IdSMTP1.Disconnect;
end;
except
application.MessageBox('邮件地址不正确,或代理设置出错,或登陆名称与口令不正确。', '错误', MB_OK + MB_ICONERROR);
//continue;
end;
以上代码,我用公司的服务又得!实在不解~~~
解决方案 »
- 求救:在panel上DrawFocusRect,无反应
- ADOTABLE1组件修改IndexName、IndexFields属性的问题.
- 关于多线程的!(100分相ZENG,不懂的只管UP吧!人人有份)
- 安徽省芜湖市的程序员过来看看
- 如何编写关于主机COM通信串口的程序?
- 在Delphi开发中,大家有用些什么测试与调试工具.推建推建,来者有分.
- 怎么Jpeg1 : TJPEGIMAGE;变量定义通不过
- dbgrid问题???急用呀??
- 用TDrawGriD网格绘图出问题,在线等待!!
- ●●●●●●●●如何实现月为30天,年为360天的转换?●●●●●●●●
- 〓★★★〓本人对编辑器要求极高,所以写了这个CodeFast〓★★★〓
- 在D7中如何屏蔽word、EXCEL中右上角的 关闭按钮
---------------------------IdSMTP1.Host := 'Smtp.163.com'
早就试过了,不行呀~~
要和userId一致吧