jmail4.1用pop3收信的例子

2016-01-29 17:20 5 1 收藏

jmail4.1用pop3收信的例子,jmail4.1用pop3收信的例子

【 tulaoshi.com - ASP 】

  <%  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:EMailattachments" & at.Filename )
             getAttachments = getAttachments & "<a href=""/EMail/attachments/" & at.Filename &"""" &_
                                 at.FileName & "(" & at.Size  & " bytes)" & "</a" & separator
          Next
    End Function
      
    %    
    <html
      <body
        <TABLE
        &nbs

来源:https://www.tulaoshi.com/n/20160129/1501031.html

延伸阅读
1.打开VS.NET 2003. 2.新建一个WinForm Application.3.添加命名空间 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Net;using System.Net.Sockets;using System.Text;using System.IO; 4.主要代码 为了防止...
在Internet,POP3(PostOfficeProtocol3)协议通常被用来接收电子邮件。这个协议很容易学,因为它只包含12个命令(其中有3个你完全可以忽略它们的存在)。这些命令被客户端计算机用来发送给远程服务器。反过来,服务器返回给客户端计算机两个回应代码。如果你还没有看本站另一篇文章-“WinsockTerminal示例程序”的话,请先阅读那篇文章,因为你需...
谷歌Gmail邮箱pop3/imap开启图文教程   1、登录您的Gmail,点击右上角的齿轮图标,选择设置。 2、,进入设置页面,并选择转发和POP/IMAP设置项。未开启POP服务会显示状态:POP已禁用。从对所有邮件启用POP和仅从现在起收到的邮件启用POP中任选一项。 对所有邮件启用POP表示将通过POP收取您的Gmail邮箱中所有邮件。 ...
//希望通过这篇文章,你可以用C#写出自己的Email客户端程序 This is a follow up to my SMTP example that shows how to access your POP3 server. This program connects and logs on to your POP3 server, and checks to see how many new messages you have. The instantiation of the POP is in Main() like this: POP pop = new POP(...
  一: 概述  本文旨在介绍如何使用开放源软件Procmail和Qpopper来配置一台可供大量用户使用的POP3服务器,重点在于如何保持最佳的服务器性能。  二: 步骤  软件环境为RedHat Linux 7.1  1. 下载最新版的Procmail和Qpopper  Procmail 最新版本现在是3.21 可从 http://www.procmail.org/procmail-3.21.tar.gz...

经验教程

753

收藏

87
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部