if NMSMTP1.Connected then begin
nmsmtp1.EncodeType := uuMime;
nmsmtp1.PostMessage.FromAddress := EditUserId.Text;
nmsmtp1.PostMessage.ToAddress.Text := EditReceiver.Text;
nmsmtp1.PostMessage.Body.Text := Memo1.Lines.Text;
nmsmtp1.PostMessage.Attachments.Text := ListBox1.Items.Text;
nmsmtp1.PostMessage.Subject := EditSubject.Text;
nmsmtp1.SendMail;
end
else
StatusBar1.Panels[0].Text := '当前未与服务器连接';错误信息:
553 you are not authorized to send mail as <MAIL FROM;<cutecheng>>,
authentication is required.后来我找了个例子,加上下面几句: nmsmtp1.Transaction('auth login');
nmsmtp1.Transaction(strUserName);
nmsmtp1.Transaction(strPassword);
还是出现同样的错误,怎么办啊?
nmsmtp1.EncodeType := uuMime;
nmsmtp1.PostMessage.FromAddress := EditUserId.Text;
nmsmtp1.PostMessage.ToAddress.Text := EditReceiver.Text;
nmsmtp1.PostMessage.Body.Text := Memo1.Lines.Text;
nmsmtp1.PostMessage.Attachments.Text := ListBox1.Items.Text;
nmsmtp1.PostMessage.Subject := EditSubject.Text;
nmsmtp1.SendMail;
end
else
StatusBar1.Panels[0].Text := '当前未与服务器连接';错误信息:
553 you are not authorized to send mail as <MAIL FROM;<cutecheng>>,
authentication is required.后来我找了个例子,加上下面几句: nmsmtp1.Transaction('auth login');
nmsmtp1.Transaction(strUserName);
nmsmtp1.Transaction(strPassword);
还是出现同样的错误,怎么办啊?
解决方案 »
- 软件是如何进行通信的?
- 从MDB数据库导入数据到SQL SERVER数据库中
- 如何获得启动参数,高手才进来
- "Access violation at address 400057B0 in module 'rtl70.bpl'."
- d7调用excel出错not supported by automation object
- 怎样在Delphi应用程序中直接通过Twain控制扫描仪,在线等待......
- Delphi7 求:如何修改一个TImageButton控件成为一个分组控制按键?
- 有里有的下《Delphi 5.x 分布式多层应用系统篇》
- 这样一个简单的交换控件的name属性也会出错??在线等,当场结贴给分~
- 进来笑笑,轻松一下(本人真事):今天你戴罩了吗?
- 关于ado 连sql2000的问题
- 今天急着发布程序,哪位老兄提供一下好的软件保护加密方法啊 ?????在线等!
begin
if nmsmtp_my.ReplyNumber = 250 then
nmsmtp_my.Transaction('auth login');
if nmsmtp_my.ReplyNumber = 334 then
begin
nmsmtp_my.Transaction(EncodeBase64('cww'));//用户名
nmsmtp_my.Transaction(EncodeBase64('fha'));//密码
end;
showmessage(inttostr(nmsmtp_my.ReplyNumber));end;
function EncodeBase64(Source:string):string;
var
Times, LenSrc, i: Integer;
x1, x2, x3, x4: Char;
xt: Byte;
begin
Result := '';
LenSrc := Length(Source);
if LenSrc mod 3 = 0 then
Times := LenSrc div 3
else
Times := LenSrc div 3 + 1;
for i := 0 to Times - 1 do
begin
if LenSrc >= (3 + i * 3) then
begin
x1 := BaseTable[(ord(Source[1 + i * 3]) shr 2)+1];
xt := (ord(Source[1 + i * 3]) shl 4) and 48;
xt := xt or (ord(Source[2 + i * 3]) shr 4);
x2 := BaseTable[xt + 1];
xt := (Ord(Source[2 + i * 3]) shl 2) and 60;
xt := xt or (Ord(Source[3 + i * 3]) shr 6);
x3 := BaseTable[xt + 1];
xt := (ord(Source[3 + i * 3]) and 63);
x4 := BaseTable[xt + 1];
end
else if LenSrc >= (2 + i * 3) then
begin
x1 := BaseTable[(Ord(Source[1 + i * 3]) shr 2) + 1];
xt := (Ord(Source[1 + i * 3]) shl 4) and 48;
xt := xt or (Ord(Source[2 + i * 3]) shr 4);
x2 := BaseTable[xt + 1];
xt := (Ord(Source[2 + i * 3]) shl 2) and 60;
x3 := BaseTable[xt + 1];
x4 := '=';
end else
begin
x1 := BaseTable[(Ord(Source[1 + i * 3]) shr 2)+1];
xt := (Ord(Source[1 + i * 3]) shl 4) and 48;
x2 := BaseTable[xt + 1];
x3 := '=';
x4 := '=';
end;
Result := Result + x1 + x2 + x3 + x4;
end;
end;