用indy里的SMTP怎么发邮件?? Host/Username/Port/Password我都填了,怎么就连不上?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将AuthenticationType属性置为AtLogin. 有DEMO呢,http://www.nevrona.com/indy有下载。 用Delphi7上控件 TidMessage,TidSMTP来发送电子邮件(编写:雨中太阳):定义变量 UserEmail:string;//收件人邮件地址 SmtpAuthType:integer;//验证 SmtpServerUser:string;//登陆SMTP服务器的用户名 SmtpServerPassword:string;//登陆SMTP服务器用到的密码 SmtpServerName:string;//SMTP服务器名.例如:smtp.sohu.com SmtpServerPort:integer;//SMTP服务器端口,默认的是25以下是发送过程.其中idMsgSend:TidMessage,SMTP:TidSMTP;分别在Indy Clients和Indy Misc页上.procedure TForm1.BitBtn1Click(Sender: TObject);begin with IdMsgSend do begin Body.Assign(Memo1.Lines); From.Text := '[email protected]'; //发件人 ReplyTo.EMailAddresses :=UserEmail ; Recipients.EMailAddresses :=UserEmail; { To: header }//收件人地址 Subject := 'kkkkkkkkkkk'; { Subject: header } //邮件主体// Priority := TIdMessagePriority(cboPriority.ItemIndex); { Message Priority } //邮件优先级// CCList.EMailAddresses := edtCC.Text; {CC} //抄送// BccList.EMailAddresses := edtBCC.Text; {BBC} //暗送 if chkReturnReciept.Checked then //需要已读回执 begin {We set the recipient to the From E-Mail address } ReceiptRecipient.Text := From.Text; end else begin {indicate that there is no receipt recipiant} ReceiptRecipient.Text := ''; end; end; authentication settings //是否需要验证 case SmtpAuthType of 0: SMTP.AuthenticationType := atNone; 1: SMTP.AuthenticationType := atLogin; {Simple Login } end; SMTP.Username := SmtpServerUser; SMTP.Password := SmtpServerPassword; {General setup} SMTP.Host := SmtpServerName; SMTP.Port := SmtpServerPort; {now we send the message} SMTP.Connect; try SMTP.Send(IdMsgSend); showmessage('发送成功!'); finally SMTP.Disconnect; showmessage('发送失败!'); end;end; 请教一下邮箱的操作 求救ADOConnection数据库路径连接问题 这个问题想了我一天,总是弄不出来,大虾能帮我看看吗,读文本问题 请问OA程序员有前途吗,主要是做什么工作的? 如何判断字符串是数字字符串? 为什么偏偏就是运行不了李维WEB SERVICES上第一个例子呢?求大虾来救命呀! ~~Delphi菜题~~~ 请帮我看一下这个问题,谢谢大家了。(急的快哭了) 通过 delphi 将DBF转换成txt 帮帮忙,用那个API函数 真诚求教:关于获取其他应用程序窗体中edit控件的句柄问题,请各位大虾不吝指教!!!!!!!!!!!!! Delphi 與 Word, Excel 的交互。
定义变量
UserEmail:string;//收件人邮件地址
SmtpAuthType:integer;//验证
SmtpServerUser:string;//登陆SMTP服务器的用户名
SmtpServerPassword:string;//登陆SMTP服务器用到的密码
SmtpServerName:string;//SMTP服务器名.例如:smtp.sohu.com
SmtpServerPort:integer;//SMTP服务器端口,默认的是25
以下是发送过程.其中idMsgSend:TidMessage,SMTP:TidSMTP;分别在Indy Clients和Indy Misc页上.
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
with IdMsgSend do
begin
Body.Assign(Memo1.Lines);
From.Text := '[email protected]'; //发件人
ReplyTo.EMailAddresses :=UserEmail ;
Recipients.EMailAddresses :=UserEmail; { To: header }//收件人地址
Subject := 'kkkkkkkkkkk'; { Subject: header } //邮件主体
// Priority := TIdMessagePriority(cboPriority.ItemIndex); { Message Priority } //邮件优先级
// CCList.EMailAddresses := edtCC.Text; {CC} //抄送
// BccList.EMailAddresses := edtBCC.Text; {BBC} //暗送
if chkReturnReciept.Checked then //需要已读回执
begin {We set the recipient to the From E-Mail address }
ReceiptRecipient.Text := From.Text;
end
else
begin {indicate that there is no receipt recipiant}
ReceiptRecipient.Text := '';
end;
end; authentication settings //是否需要验证
case SmtpAuthType of
0: SMTP.AuthenticationType := atNone;
1: SMTP.AuthenticationType := atLogin; {Simple Login }
end;
SMTP.Username := SmtpServerUser;
SMTP.Password := SmtpServerPassword; {General setup}
SMTP.Host := SmtpServerName;
SMTP.Port := SmtpServerPort; {now we send the message}
SMTP.Connect;
try
SMTP.Send(IdMsgSend);
showmessage('发送成功!');
finally
SMTP.Disconnect;
showmessage('发送失败!');
end;
end;