当前位置: 首页 > 图文教程 > 网络编程 > ASP > jmail4.1用pop3收信的例子

ASP
网络寻呼机数据库版删除选中的消息deletemessage.asp
网络寻呼机数据库版隐藏文件watch.asp
网络寻呼机数据库版总结
一种在线人数统计方法(只用1个APPLICATION)
用ASP.NET构建完整E-mail发送系统
用ASP.NET建立简单的Web Form
为你的ASP程序制作一个编译组件(上)
为你的ASP程序制作一个编译组件(中)
为你的ASP程序制作一个编译组件(下)
利用ASP将HTML格式数据传输给Excel(1)
利用ASP将HTML格式数据传输给Excel(2)
利用ASP将HTML格式数据传输给Excel(3)
利用ASP将HTML格式数据传输给Excel(4)
磁盘ID在ASP源码防拷贝中的应用
WEB环境下打印报表的crystal的解决方案
如何把存储在数据库中的图片根据自己的需要的大小显示出来
客户端用ASP+rds+VBA参生报表
利用ASP.NET设计FTP文件上传(上)
利用ASP.NET设计FTP文件上传(中)
利用ASP.NET设计FTP文件上传(下)

ASP 中的 jmail4.1用pop3收信的例子


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 42 ::
收藏到网摘: n/a

  <%  Set pop3 = Server.CreateObject( "JMail.POP3" )
  
  'pop3的连接用户名,密码,pop3地址
  pop3.Connect "username", "password", "mail.mydomain.com"

  Response.Write( "你有" & pop3.count & " 封邮件。<br><br>" )

  if pop3.count > 0 then
    Set msg = pop3.Messages.item(1)     
    ReTo = ""
    ReCC = ""
    
    Set Recipients = msg.Recipients
    separator = ", "
    
    ' 现在得到所有的收件人,并且存储
    
    For i = 0 To Recipients.Count - 1
        If i = Recipients.Count - 1 Then
            separator = ""
        End If
    
        Set re = Recipients.item(i)
        If re.ReType = 0 Then
            ReTo = ReTo & re.Name & "&nbsp;(<a href=""mailto:"& re.EMail &""">" & re.EMail & "</a>)" &
separator
        else
            ReCC = ReTo & re.Name & "&nbsp;(<a href=""mailto:"& re.EMail &""">" & re.EMail & "</a>)" &
separator
        End If
    Next
    
    '这个程序得到附件,并且保存到服务器的硬盘上。也可以返回附件的详细连接
    Function getAttachments()
          Set Attachments = msg.Attachments
          separator = ", "
    
          For i = 0 To Attachments.Count - 1
            If i = Attachments.Count - 1 Then
                separator = ""
             End If
    
             Set at = Attachments(i)
             at.SaveToFile( "c:\EMail\attachments\" & at.Filename )
             getAttachments = getAttachments & "<a href=""/EMail/attachments/" & at.Filename &""">" &_
                                 at.FileName & "(" & at.Size  & " bytes)" & "</a>" & separator
          Next
    End Function
      
    %>    
    <html>
      <body>
        <TABLE>
       &n