NMSMTP1.UserID := Edit2.Text
设置这个属性,你的用户名

解决方案 »

  1.   

    Insert the following code into NMSMTP1's OnAttachmentNotFound event:procedure TForm1.NMSMTP1AttachmentNotFound(Filename: String);
    begin
      Memo5.Lines.Add('File attachment '+FileName+' not found');
    end;If one of the files specified in ListBox1 does not exist when the Button2 is clicked, the OnAttachmentNotFound event is called. In this case, the status window, Memo5, is updated to inform the user that a specified attachment was not found, and which file it was that was not found.Insert the following code into NMSMTP1's OnAuthenticationFailed event:procedure TForm1.NMSMTP1AuthenticationFailed(var Handled: Boolean);
    var
      S: String;
    begin
      S := NMSMTP1.UserID;
      if InputQuery('Authentication Failed', 'Invalid User ID. New User ID: ', S) then
      begin
        NMSMTP1.UserID := S;
        Handled := TRUE;
      end;
    end;
      

  2.   

    用户名是指?辟如,那用户名是否就是abc呢???谢了
      

  3.   

    procedure TForm1.NMSMTP1Connect(Sender: TObject);
    var
        strUserName,strPassword:string;
    begin
        {如果SMTP服务器需要认证,则进行认证}
        if chkSmtpVerify.Checked = True then
        begin
            {对用户名和密码进行Base64编码}
            strUserName:=EncodeString(txtUserName.Text);
            strPassword:=EncodeString(txtPassword.Text);        {进行认证,输入编码后的用户名、密码}
            nmsmtp1.Transaction('auth login');
            nmsmtp1.Transaction(strUserName);
            nmsmtp1.Transaction(strPassword);
        end;
    end;
    给我加分哦!我以前做过,很容易的。
      

  4.   

    是啊,[email protected]中,“abc”就是你的用户名!
    有的服务器要密码认证,这就不知道设置哪个属性了,请高手说说吧
      

  5.   

    to hezchuan168(开心果) ,发送不需要用户名和口令吧
      

  6.   

    to hezchuan168(开心果),EncodeString 是哪定义的,没有呀???
      

  7.   

    对于不需要密码的服务器用TNMSMTP没问题,直接用USERID;RFC821对于需要密码的服务器要用TIdSMTP;有USERID和PASSWORD属性,但要把AuthenticationType设成atLogin。有兴趣看看这个RFC2554:
    http://www.rfc-editor.org/rfc/rfc2554.txt
      

  8.   

    现在的免费邮箱都需要SMTP认证的。
    对了 TNMSMTP 没有AuthenticationType 属性。
      

  9.   

    需要验证你的用户名和对方的用户名是否存在
    如果都正确,smtp发送邮件
    有一个错误,smtp不执行发送操作
      

  10.   

    to:hezchuan168(开心果)
    你那种方法我用过,去年编的回邮系统就是这么做,没错,很容易就能通过smtp认证发送邮件了。但最近作邮件接受发送程序时,遇到问题:完成nmsmtp1.Transaction('auth login');后,smtp1.ReplyNumber竟然是503,而不是334,无法进行密码验证。我不知道是公司防火墙原因还是邮件服务器原因,要不是程序需要升级了?我用的是tnmsmtp组件