国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

jmail4.1用pop3收信的例子

2019-11-18 20:40:13
字體:
供稿:網(wǎng)友
<%  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 = ", "
    
    ' 現(xiàn)在得到所有的收件人,并且存儲
    
    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
    
    '這個程序得到附件,并且保存到服務(wù)器的硬盤上。也可以返回附件的詳細(xì)連接
    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>
          <tr>
            <td>郵件標(biāo)題</td>
            <td><%= msg.Subject %></td>
          </tr>
          <tr>
            <td>發(fā)件人</td>
            <td><%= msg.FromName %></td>
          </tr>
          <tr>
            <td>收件人</td>
            <td><%= ReTO %></td>
          </tr>
          <tr>
            <td>抄送</td>
            <td><%= ReCC %></td>
          </tr>
          <tr>
            <td>附件</td>
            <td><%= getAttachments %></td>
          </tr>
          <tr>
            <td>內(nèi)容</td>
            <td><PRe><%= msg.Body %></pre></td>
          </tr>        
        </TABLE>
      </body>
    </html>

<%  end if

  pop3.Disconnect

%>


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 安阳县| 越西县| 长岭县| 土默特右旗| 延安市| 遂川县| 高平市| 根河市| 芮城县| 望城县| 方城县| 双辽市| 视频| 仁化县| 扎囊县| 新邵县| 阜平县| 曲阜市| 林周县| 韩城市| 泸水县| 彭泽县| 同德县| 吉木萨尔县| 应城市| 青岛市| 二连浩特市| 理塘县| 桂平市| 房山区| 商丘市| 西吉县| 比如县| 隆林| 沛县| 偃师市| 山阴县| 巧家县| 东明县| 綦江县| 中宁县|