|
|
||||
|
ANPOP is one of the high performance and comprehensive POP3 COM Object. With ANPOP, your ASP, VB, VC++, C#, .NET framework or other COM environment applications can retrieve email from mail server based on POP3 protocol and parse email based on MIME.
ANPOP Component supports all operations of POP3 protocol. It incorporates POPMSG function that parses email structure, abstracting specified stuffs from Message Body, such as Recipients, Subject, Body, Attachment and more. It also provides MAILSTORE object to store email in local disk easily. Developer can easily use it to develop email client tool and web application. |
|
Quick Tutorial - ASP/VB/VC++ With only some simple scripts your applications will be enabled to retreive email from POP3 server and parse email based on MIME. |
|
ASP Sample
This sample demonstrates how to receive pop3 email in ASP
Set POP3 =Server.CreateObject("ANPOP.POPMAIN") 'create pop3 main object
Set POP3_MSG = Server.CreateObject("ANPOP.POPMSG") 'create pop3 msg object
Dim lRet, lCount
lRet = POP3.Connect( "pop3.email.com", "asp", "asp.net" ) 'connecting pop3 server
If lRet = 0 Then
lCount = POP3.GetTotalOfMails()
For i = 1 To lCount
POP3_MSG.RawContent = POP3.Retrieve( i )
'Saving email to disk
POP3_MSG.ExportFile "c:\pop3" & i & ".eml"
'Deleting email from pop3 server
POP3.Delete i
Next
End If
'Cancel deletion operations
'POP3.Reset
POP3.Close
|
|
Visual Basic Sample ( Retrieve Email )
This sample demonstrates how to retrieve pop3 email in Visual Basic
Dim POP3 As Object
Dim POP3_MSG As Object
Set POP3 = Server.CreateObject("ANPOP.POPMAIN") 'create pop3 main object
Set POP3_MSG = Server.CreateObject("ANPOP.POPMSG") 'create pop3 msg object
Dim lRet As Long
Dim lCount As Long
lRet = POP3.Connect( "pop3.email.com", "asp", "asp.net" ) 'connecting pop3 server
If lRet = 0 Then
lCount = POP3.GetTotalOfMails()
For i = 1 To lCount
POP3_MSG.RawContent = POP3.Retrieve( i )
'Saving email to disk
POP3_MSG.ExportFile "c:\pop3" & i & ".eml"
'Deleting email from pop3 server
POP3.Delete i
Next
End If
'Cancel deletion operations
'POP3.Reset
POP3.Close
|
|
Visual Basic Sample ( Parse Email )
'This sample demonstrates how to parse email in Visual Basic
Dim POP3_MSG As Object
Set POP3_MSG = CreateObject("ANPOP.POPMSG") 'create com object
Dim lCount As Long
POP3_MSG.ImportFile "c:\pop3_test.eml" 'import email to this component
MsgBox "BodyText: " & POP3_MSG.GetBodyText() 'get email body text
MsgBox "Date: " & POP3_MSG.GetDate() 'get email's date
MsgBox "From: " & POP3_MSG.GetFromAddress() 'get sender's email address
MsgBox "ReplyTo: " & POP3_MSG.GetReplyTo() 'get email address to reply
MsgBox "Subject: " & POP3_MSG.GetSubject() 'get email's subject
MsgBox "Size: " & POP3_MSG.GetMessageSize() 'get email's size
'get all normal recipients' email address
lCount = POP3_MSG.GetRecipientCount()
For i = 1 To lCount
MsgBox "To: " & POP3_MSG.GetRecipientAddr(i)
Next
'get all CC recipients' email address
lCount = POP3_MSG.GetCCCount()
For i = 1 To lCount
MsgBox "CC: " & POP3_MSG.GetCCAddr(i)
Next
'save all attachments of this email to c:\
lCount = POP3_MSG.GetAttachmentCount()
For i = 1 To lCount
POP3_MSG.SaveAttachment "c:\", i
Next
|
|
Visual C++ Sample This sample demonstrates how to retrieve pop3 email in Visual C++ #include <comdef.h> #include "ANPOP.h" #include "ANPOP_i.c" //create pop3 connection object and messge object IPOPMAIN* pConnection = NULL; IPOPMSG* pMessage = NULL; HRESULT hr = ::CoInitialize( NULL ); hr = ::CoCreateInstance( CLSID_POPMAIN, NULL, CLSCTX_ALL, IID_IPOPMAIN, (LPVOID*)&pConnection ); _ASSERT( SUCCEEDED( hr ) && pConnection != NULL ); hr = ::CoCreateInstance( CLSID_POPMSG, |
|
Learn more information about ANPOP COMOPONENT
Email: support@adminsystem.net |
|