Total members 11889 |It is currently Thu Mar 28, 2024 4:51 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





read content of email inbox using SMTP in asp
Code:
<html>

<%
 
  
    Dim objSession
, strEmail, strEmails, objInbox, intCurrentID
    
'create an instance of the CDONTS.Session object 
    objSession = Server.CreateObject("CDONTS.Session")
    '
use SMTP protocal to create session to email account .
    objSession.LogonSMTP("emailpassword", "[email protected]")
    'get content of inbox.
    objInbox = objSession.Inbox
    '
get all messages in inbox folder. 
    strEmails 
= objInbox.Messages
    intCurrentID 
= Trim(Request.QueryString("MsgId"))
    Response.Write("Email inbox content:")
    If ("" = intCurrentID Or Not IsNumeric(intCurrentID)) Then
        
' loop on emails.
        '
 show list of emails.
        Dim intCount = 0
        For Each strEmail In strEmails
            intCount 
= intCount + 1
            
'create a link to email message.
            Response.Write("<a href=""")
            Response.Write(Request.ServerVariables("SCRIPT_NAME"))
            Response.Write("?MsgId=" & intCount & """>" & strEmail.Subject)
            Response.Write("</a>")
            Response.Write("<b> Sender :</b> " & strEmail.Author)
            Response.Write("<br>")
        Next
    Else
        strEmail = strEmails(intCurrentID)
        Response.Write("<b>Email Subject : </b>" & strEmail.Subject & "<br>")
        Response.Write("<b>Email Sender : </b>" & strEmail.Sender & "<br>")
        Response.Write("<b>Email Message : </b>" & strEmail.Text)
    End If
    '
close session. 
    objSession
.LogOff()
%>
</
html>
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : read email inbox ASP
 Get job’s Alert In Your Inbox     -  
 Send email in asp     -  
 Send an email in asp.net     -  
 validate email address in asp     -  
 Send email link example.     -  
 email through JAVA program     -  
 send email from ASP using CDOSYS     -  
 Email validation in Javascript     -  
 Reading email in Python     -  



Topic Tags

ASP Email
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com