用c++或者是c发送邮件,100rmb求助,要求可以发送邮件。247102883;

解决方案 »

  1.   

    你可以下载:
    http://download.csdn.net/detail/aa_qq110/3585719
    看一下,这个程序是Linux的,但是很简单。
    可以参考一下。
    实质上就是:
    1.先建立TCP连接
    2按以下协议(即SMTP协议)发送邮件:
    S: 220 smtp.example.com ESMTP Postfix
    C: HELO relay.example.org
    S: 250 Hello relay.example.org, I am glad to meet you
    C: MAIL FROM:<[email protected]>
    S: 250 Ok
    C: RCPT TO:<[email protected]>
    S: 250 Ok
    C: RCPT TO:<[email protected]>
    S: 250 Ok
    C: DATA
    S: 354 End data with <CR><LF>.<CR><LF>
    C: From: "Bob Example" <[email protected]>
    C: To: "Alice Example" <[email protected]>
    C: Cc: [email protected]
    C: Date: Tue, 15 Jan 2008 16:02:43 -0500
    C: Subject: Test message
    C:
    C: Hello Alice.
    C: This is a test message with 5 header fields and 4 lines in the message body.
    C: Your friend,
    C: Bob
    C: .
    S: 250 Ok: queued as 12345
    C: QUIT
    S: 221 Bye
    {The server closes the connection}具体参考:http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
      

  2.   

    写过一个邮件发送模块
    有兴趣看看 
    http://download.csdn.net/detail/qq752923276/3233640
      

  3.   

    http://download.csdn.net/detail/zqlong_sunday/2316289
    http://download.csdn.net/detail/jchen821214/1138229
      

  4.   

    用socket连接stmp服务器,发送HELO
    然后再依次发送各种命令,自己查RFC文档,然后auth login
    把base64加密的帐号和密码发过去。如果250就成功了
    然后再写包头,正文。以及附件。完毕。
      

  5.   

    如果想发送html的话,需要修改charset