E
endsky
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
AMsg :TIdMessage;
SMTP: TIdSMTP;
begin
AMsg :=TIdMessage.Create(self);
with AMsgdo
begin
Body.Text :='这里是信件内容';
From.Text :='lixh99@126.com';
Recipients.EMailAddresses := 'lixh1999@163.com';
{收件人地址}
Subject := 'test';
{ 标题 }
Priority := TIdMessagePriority(1);
{ 优先级 }
CCList.EMailAddresses := '';
{ 抄送 }
BccList.EMailAddresses := '';
{ 暗送 }
ReceiptRecipient.Text := 'lixh99@126.com';
SMTP.Authen
ticationType := atLogin;
SMTP.Username:= 'lixh99';
SMTP.Password := '888888';
{General setup}
SMTP.Host := 'smtp.126.com';
SMTP.Port := 25;
SMTP.Connect();
try
SMTP.Send(AMsg);
finally
SMTP.Disconnect;
end;
AMsg.Free();
showmessage('过程完成,如果没有出错,估计是成功啦');
end;
end;
报错:Project Project2.exe raised excepton class EIdProtocoReplyError with message "bad sequence of commands"
求大家帮忙呀!
开始我用的是新浪邮箱,因为ping不通'smtp.sina.com',所以改为126邮箱发送邮件
var
AMsg :TIdMessage;
SMTP: TIdSMTP;
begin
AMsg :=TIdMessage.Create(self);
with AMsgdo
begin
Body.Text :='这里是信件内容';
From.Text :='lixh99@126.com';
Recipients.EMailAddresses := 'lixh1999@163.com';
{收件人地址}
Subject := 'test';
{ 标题 }
Priority := TIdMessagePriority(1);
{ 优先级 }
CCList.EMailAddresses := '';
{ 抄送 }
BccList.EMailAddresses := '';
{ 暗送 }
ReceiptRecipient.Text := 'lixh99@126.com';
SMTP.Authen
ticationType := atLogin;
SMTP.Username:= 'lixh99';
SMTP.Password := '888888';
{General setup}
SMTP.Host := 'smtp.126.com';
SMTP.Port := 25;
SMTP.Connect();
try
SMTP.Send(AMsg);
finally
SMTP.Disconnect;
end;
AMsg.Free();
showmessage('过程完成,如果没有出错,估计是成功啦');
end;
end;
报错:Project Project2.exe raised excepton class EIdProtocoReplyError with message "bad sequence of commands"
求大家帮忙呀!
开始我用的是新浪邮箱,因为ping不通'smtp.sina.com',所以改为126邮箱发送邮件