ASP Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar
ASP Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

POP3 to SMTP Forwarder

Download Chilkat Email ActiveX

Read a POP3 mailbox and forwards the email to another email address, keeping the recipients in the original email the same.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
'  The mailman object is used for receiving (POP3)
'  and sending (SMTP) email.
set mailman = Server.CreateObject("Chilkat.MailMan2")

'  Any string argument automatically begins the 30-day trial.
success = mailman.UnlockComponent("30-day trial")
If (success <> 1) Then
    Response.Write "Component unlock failed" & "<br>"

End If

'  Set the POP3 server's hostname
mailman.MailHost = "mail.chilkatsoft.com"

'  Set the POP3 login/password.
mailman.PopUsername = "matt@chilkatsoft.com"
mailman.PopPassword = "****"

'  The the UIDLs for all email in the POP3 mailbox.
Set saUidls = mailman.GetUidls()
If (saUidls Is Nothing ) Then
    Response.Write mailman.LastErrorText & "<br>"

End If

'  Download the email from the server.  Call FetchMultipleMime
'  because we don't want to load the emails into email objects.
'  (We'll delete the emails that are forwarded without error.)
Set saMime = mailman.FetchMultipleMime(saUidls)

If (saMime Is Nothing ) Then

    Response.Write mailman.LastErrorText & "<br>"

End If

'  Set the SMTP hostname for sending.
mailman.SmtpHost = "mail.chilkatsoft.com"
mailman.SmtpUsername = "admin@chilkatsoft.com"
mailman.SmtpPassword = "****"

n = saMime.Count

fromAddr = "matt@chilkatsoft.com"
toAddr = "admin@chilkatsoft.com"

bAllOk = 1

If (n > 0) Then
    For i = 0 To n - 1

        strMime = saMime.GetString(i)

        '  Forward the email.
        success = mailman.SendMime(fromAddr,toAddr,strMime)
        If (success <> 1) Then
            bAllOk = 0
            Response.Write Server.HTMLEncode( mailman.LastErrorText) & "<br>"
            Exit Do
        End If

    Next
End If

'  Remove the emails in saUidls from the POP3 server.
If (bAllOk = 1) Then
    success = mailman.DeleteMultiple(saUidls)
    If (success <> 1) Then
        Response.Write Server.HTMLEncode( mailman.LastErrorText) & "<br>"
    End If

End If


%>
</body>
</html>

 

© 2000-2013 Chilkat Software, Inc. All Rights Reserved.