闷呀!调试了一天还搞不定(100分)

  • 主题发起人 主题发起人 gbyahoo
  • 开始时间 开始时间
G

gbyahoo

Unregistered / Unconfirmed
GUEST, unregistred user!
1. 为什么 host 一定要接受方的主机kiss.com才能发送正常?
2. 为什么
MsgSend.Recipients.EMailAddresses := test@kiss.com; { To: header }
和 SMTP.Host := 'kiss.com';才能发送,如果SMTP.Host := '163.net'就发送不了,但是可以连接服务器SMTP.Connect;.发送时出现'553错误.


 SMTP.Host := 'kiss.com';
SMTP.Port := 25;
SMTP.Connect;
MsgSend.Body.Clear;
MsgSend.Body.Assign(memo1.Lines);
MsgSend.From.Text := gasww@163.net;
MsgSend.Recipients.EMailAddresses := test@kiss.com; { To: header }
MsgSend.Subject := 'test'; { Subject: header }
try
SMTP.Send(MsgSend);
finally
SMTP.Disconnect;
 
var
PriorityIdx, Port: integer;
SendMailBox, UserName, Passwd, SmtpHost: string;
begin
if trim(edTo.Text)='' then Exit;
Screen.Cursor := crHourGlass;
for PriorityIdx:=0 to pmPriority.Items.Count-1 do
begin
if pmPriority.Items[PriorityIdx].Checked then break;
end;
with IdMsgSend do
begin
Body.Assign(reBody.Lines);
From.Text := FAItems.Items[FSendMailBoxIndex].MailAddress;
ReplyTo.EMailAddresses := FAItems.Items[FSendMailBoxIndex].MailAddress;
Recipients.EMailAddresses := edTo.Text; { To: header }
Subject := edSubject.Text; { Subject: header }
Priority := TIdMessagePriority(PriorityIdx); { Message Priority }
CCList.EMailAddresses := edCC.Text; {CC}
BccList.EMailAddresses := edBCC.Text; {BBC}
if chkReturnReciept.Checked then {We set the recipient to the From E-Mail address }
ReceiptRecipient.Text := cbFrom.Text
else {indicate that there is no receipt recipiant}
ReceiptRecipient.Text := '';
end;

{authentication settings}
if FAItems.Items[FSendMailBoxIndex].IfAuthentication then
idSMTP.AuthenticationType := atLogin
else
idSMTP.AuthenticationType := atNone;
idSMTP.Username := FAItems.Items[FSendMailBoxIndex].UserName;
idSMTP.Password := FAItems.Items[FSendMailBoxIndex].Passwd;

{General setup}
idSMTP.Host := FAItems.Items[FSendMailBoxIndex].SmtpSer;
idSMTP.Port := FAItems.Items[FSendMailBoxIndex].SmtpPort;

{now we send the message}
idSMTP.Connect;
try
frmPub_HintInfo := TfrmPub_HintInfo.Create(Application);
frmPub_HintInfo.Show;
frmPub_HintInfo.Panel1.Caption := 'Sending to ' + edTo.Text;
frmPub_HintInfo.Update;
idSMTP.Send(IdMsgSend);
finally
idSMTP.Disconnect;
frmPub_HintInfo.Close;
end;
Screen.Cursor := crDefault;
end;
 
不行呀!大哥,留下qq吧
 
我没有QQ的,我这几天也正折腾着,但我就是发现:
From.Text ;
ReplyTo.EMailAddresses ;
idSMTP.Host 要是同一网站的,比如163.net
 
这就不好办了,如果abc@tom.com呢?一定发不了,因为没有tom.com的mail主机.
如果是 abc@163.net 算还可以,但这样做一定不行,因为不知用户用的是什么样的mail其所对应的mail服务器关系.还是闷呀!
不知FOXMAIL是怎么处理的?哎呀!
 
接受答案了.
 
后退
顶部