Total members 10249 | Gratitudes |It is currently Thu May 17, 2012 7:12 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: read email inbox ASP
PostPosted: Fri Apr 08, 2011 9:18 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2272
Location: Earth
Has thanked: 39 time
Have thanks: 61 time

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", "youremail@domain.com")
    '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>
 

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 Read your gmail using Java code
 read ibooks on pc
 read php file in asp and display it as html
 javascript read file
 Send email link example.
 Email validation in Javascript
 read file in matlab
 How to read string text in files
 i want to send conformation email with user details on the
 validate email address in asp

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team