用smtp发送邮件时,要求加入身份验证(像163就是的)应该怎样加入身份验证!

解决方案 »

  1.   

    免费的MFC类CSMTPConnection(http://www.naughter.com/smtp.html),它支持所有3种模式login。
      

  2.   

    EHLO host
    AUTH LOGIN
    base64编码的username
    base64编码的password
    MAIL FROM:
    .....
      

  3.   

    strBuf.Format("AUTH LOGIN\r\n");
    m_SmtpServer.Send(strBuf, strlen(strBuf));
    m_SmtpServer.Receive(rec, 30);
    MessageBox(rec); strBuf.Format("cGNsaWxpNTIw\r\n");
    m_SmtpServer.Send(strBuf, strlen(strBuf));
    m_SmtpServer.Receive(rec, 30);
    MessageBox(rec); strBuf.Format("MrIzOCDMrxMhjQ \r\n");
    m_SmtpServer.Send(strBuf, strlen(strBuf));
    m_SmtpServer.Receive(rec, 30);
    MessageBox(rec);
     这样有错吗?
    为什么不能通过验证呀??????????
      

  4.   

    是不是编码错误呀。
    用户名是pclili520