提取发送的人,可以有from: 标识,接受人有to:标识,  那么,正文是用什么标识开始,用什么标识结束呢

解决方案 »

  1.   

    //新建CPOP3对象
    CPOP3 pop3( m_POP3 );
    pop3.SetUserProperties(m_User,m_Password); //连接POP3服务器
    if (!pop3.Connect())
    {
    AfxMessageBox( pop3.GetLastError() );
    return;
    } //收取信件
    CMailMessage msg;
    if (!pop3.GetMessage(1,&msg))
    {
    AfxMessageBox( pop3.GetLastError() );
    return;
    } //显示信件
    m_Body=msg.m_sBody;   //内容
    m_Subject=msg.m_sSubject;//主题
    m_From=msg.m_sFrom;//from
    m_To=""; //to
    for (int a=0; a<msg.GetNumRecipients(); a++)
    {
    CString sEmail;
    CString sFriendly;
    msg.GetRecipient(sEmail,sFriendly,a);
    m_To+=sEmail;
    m_To+=" ";
    }
    m_To.TrimRight(); //断开连接
    if( !pop3.Disconnect() )
    {
    AfxMessageBox( pop3.GetLastError() );
    return;
    }
    AfxMessageBox( _T( "Successfully disconnected" ) );
      

  2.   

    这个需要进行文本分析得
    From: "Sender"<[email protected]>
    To: "You"<[email protected]>
    Subject:这是一个测试邮件dsfljsldjfs
    基本上就是这个格式,细节需要学MIME 标准,有5个RFC
      

  3.   

    my_girlf  我获取的是ip包,不是用的cpop3类
      

  4.   

    my_girlf  我没有用cpop3,用的是winpcap,获取的ip包.不过同样谢谢你.
    arong1234 你决的应该怎么处理呢?
      

  5.   

    http://topic.csdn.net/u/20070331/14/286e0f9d-d0a6-42f0-b95c-57769bbb1a19.html
    这个就是正文的内容.大家有兴趣帮我看看,这个兄弟和我碰到的问题是一样的。
      

  6.   

    邮件头部有一个boundary属性
    拿到后面的内容
    然后找 "==boundary的内容"之后是每个节点的开始。
    节点的属性中有内容类型,从内容类型中就知道是正文还是附件。还有编码格式,好像还有数据长度。
    按照编码规定解码即可。其实这些内容你找一下mime的rfc文档就知道如何解析了。