ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 28th, 2003, 06:00 AM
imghani imghani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Pakistan
Posts: 9 imghani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Reading Email data

Hi all,
I wanted to retrieve email from mail server based on POP3
protocol through ASP.
Please refer some good tutorial or example code doing this.

thanks.
Imran Ghani.

Last edited by imghani : August 28th, 2003 at 06:31 AM.

Reply With Quote
  #2  
Old August 28th, 2003, 07:30 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Code:
<%@ LANGUAGE="VBSCRIPT" %>

<HTML>
<HEAD>
<TITLE>Chilkat ASP Mail Example: Read a POP3 Mailbox</TITLE>
</HEAD>
<BODY>

Reading email....<br><br>

<%
	' Create a mailman
	set mailman = Server.CreateObject("ChilkatWebMail.WebMailMan")

    ' Unlock the component - use your trial or purchased unlock code.
    mailman.UnlockComponent "unlock_code"

	' Tell the mailman where to get mail, and the login/password
	mailman.MailHost = Request.Form("popHostname")
	mailman.PopUsername = Request.Form("loginName")
	mailman.PopPassword = Request.Form("password")

	' Copy the mail without removing it from the server.
	' When reading email, the mailman always returns a MailBundle
	Set mailBundle = mailman.CopyMail
	  ' To Remove the mail from the server, use TransferMail:
	  ' Set mailBundle = mailman.TransferMail

	If Not (mailBundle Is Nothing) Then

	  ' Loop over the email messages in the bundle
	  For i = 0 To mailBundle.messageCount - 1

		Set email = mailBundle.GetEmail(i)

		Response.write "<br>" & i & "<br>"
		Response.write "<b>From:</b> " & Server.HTMLEncode(email.From) & "<br>"
		Response.write "<b>Subject:</b> " & Server.HTMLEncode(email.Subject) & "<br>"
		
		if email.NumTo = 0 then
			Response.write "<b>To:</b> " & Server.HTMLEncode(email.GetTo(0)) & "<br>"
		else
			Response.write "<b>To:</b><blockquote>"
			For j = 0 to email.NumTo
				Response.write Server.HTMLEncode(email.GetTo(j)) & "<br>"
			Next
			Response.write "</blockquote><br>"
		end if

		'Response.write "<b>Raw Header:</b><br><pre>"
		'Response.write Server.HTMLEncode(email.RawHeader)
		'Response.write "</pre><br>"
		Set email = Nothing
	  Next

	End If
%>
    <br>(View page source to see the log)
    <XML ID="XMLID">
<%
    Response.write mailman.GetInstanceLog()
%>
    </XML>
<%

	Set mailBundle = Nothing

	' Standard ASP cleanup of objects
	Set mailman = Nothing

%>

<BR>DONE.<BR>

</BODY>
</HTML>

Reply With Quote
  #3  
Old August 30th, 2003, 04:35 AM
imghani imghani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Pakistan
Posts: 9 imghani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
please refer some free component

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Reading Email data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway