SMTP发邮件有成功了例子?我只要个能向163.com发送邮件的例子就可以了?我测试很多免费的,都OVER了!

解决方案 »

  1.   

    有一个人写的smtp的一系列类,在网上找找,这是他的注释:需要登录的话,关键要知道163支持什么方式的登录,然后按照他提供的方法调用就可以了/*
    Module : SMTP.H
    Purpose: Defines the interface for a MFC class encapsulation of the SMTP protocol
    Created: PJN / 22-05-1998Copyright (c) 1998 - 2004 by PJ Naughter.  (Web: www.naughter.com, Email: [email protected])All rights reserved.Copyright / Usage Details:You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise) 
    when your product is released in binary form. You are allowed to modify the source code in any way you want 
    except you cannot modify the copyright details at the top of each module. If you want to distribute source 
    code with your application, then you are only allowed to distribute versions released by the author. This is 
    to maintain a single distribution point for the source code. Please note that I have been informed recently that C(PJN)SMTPConnection is being used to develop and send unsolicted bulk mail. 
    This was not the intention of the code and the author explicitly forbids use of the code for any software of this kind without 
    my explicit written consent.*/
      

  2.   

    http://www.vckbase.com/code/downcode.asp?id=1060
      

  3.   

    目前都是支持验证的,首先你建立sock连接,端口25,服务器需要你自己设置,例如你自己的邮箱是126.com的,你就得设成smtp.126.com,连接成功后就按smtp协议流程send,recv相应的数据,验证的时候用base64编码格式对用户名和密码进行编码再传给服务器!!