Fri Apr 08, 2011 9:18 pm
<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>
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
Powered by phpBB © phpBB Group.