http://www.cndot.net/article/show.asp?id=420
http://www.cndot.net/article/show.asp?id=487

解决方案 »

  1.   

    messagemail mail=new messagemail();
    mail.to=string;
    mail.from=string;
    .....
      

  2.   

    在.net中提供了发邮件的类,但没有提供专门收邮件的类。要收邮件必须自己编写程序,你也可以用原asp组件,例如:jmail,我就使用了,还比较稳定。
      

  3.   

    Dim ds As New DataSet()
            Dim dtMlSet As DataTable
            Dim i As Integer
            Dim j As Integer
            Dim dr As DataRow
            Dim msg As jmail.Message
            Dim strValue(30) As String
            Dim sReply As String
            Dim iMailID As Integer        Dim sErr As String        dtMlSet = GetMlSet(iEmpID)        For i = 0 To dtMlSet.Rows.Count - 1
                dr = dtMlSet.Rows(i)
                ' Try
                Dim pop3 As New jmail.POP3()
                pop3.Connect(dr(1), DeMailPwd(dr(2)), dr(6), CInt(dr(7)))
                pop3.DownloadUnreadMessages()            For j = 1 To pop3.Count                msg = pop3.Messages.Item(j)                strValue(0) = Session("empid")
                    strValue(1) = dr(3)
                    strValue(2) = "<img src=../../img/mail/mail" & dr(14).ToString & ".gif>"
                    strValue(3) = 0
                    strValue(4) = msg.Text
                    strValue(5) = IIf(msg.Subject = "", "无", msg.Subject)                Try
                        strValue(6) = ChangeMlSize(msg.Size)
                        strValue(16) = msg.Size
                    Catch
                        strValue(6) = 0
                        strValue(16) = 0
                    End Try                strValue(7) = GetRe(msg.Recipients, 0)
                    strValue(8) = GetRe(msg.Recipients, 1)
                    strValue(9) = msg.Headers.Text
                    strValue(10) = IIf(msg.FromName = "", msg.From, msg.FromName)
                    strValue(11) = msg.From
                    strValue(12) = msg.Date
                    strValue(13) = msg.Body
                    strValue(14) = msg.HTMLBody                sReply = msg.ReplyTo
                    If sReply <> "" Then
                        sReply = Mid(sReply, InStr(sReply, "<") + 1, Len(sReply) - InStr(sReply, "<") - 1)
                        strValue(15) = sReply
                    End If                iMailID = SaveToMlMessage(strValue)                If msg.Attachments.Count > 0 Then
                        GetAttachments(msg, iMailID)
                    End If                '删除邮件
                    pop3.DeleteSingleMessage(j)
                Next            pop3.Disconnect()
                ' Catch
                sErr &= "登录到" & dr(6) & "时出现错误!  "
                '   End Try
            Next
            Return sErr
      

  4.   

    yhp(农场主)能否详细说明JMAIL的用法?或提供相关资料?