发送邮件问题?
帮忙看看是什么错误
错误信息 :Project Project1.exe raised exception class eidprotocolreplyerror with message'from <zhengchengqiang1103@21cn.com>,message blocked you are not authorzed to send mail,authenrication is requited'.
代码如下:
连接 主机:
procedure TForm1.Button1Click(Sender: TObject);
begin
idsmtp1.Host:=trim(edit1.Text); //主机
idsmtp1.Username:=trim(edit2.Text);//用户名
idsmtp1.Password:=trim(edit3.Text);//密码
idsmtp1.Port:=25;//端口
try
idsmtp1.Connect(3000);
except
idsmtp1.Disconnect
end;
end;
发送 邮件:
procedure TForm1.Button2Click(Sender: TObject);
begin
with idmessage1 do
begin
Body.Assign(memo1.Lines); //邮件正文
From.Address := Trim(edit4.Text); //发件人地址
Recipients.EMailAddresses := Trim(edit5.Text); //收件人地址
Subject := edit6.Text; //邮件主题
end;
try
idsmtp1.Send(idmessage1);
except
idsmtp1.Disconnect
end;
end;
问题点数:10、回复次数:1Top
1 楼congjl(congjl)回复于 2006-05-10 15:57:14 得分 0
你的邮件服务器对发送邮件需要认证Top




