Visual Basic Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB Examples

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

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


VB Strings
VB Byte Array

 

 

 

 

 

 

 

Attached Email Messages (message/rfc822)

Download Chilkat Email ActiveX

This article discusses the topic of attached email messages. An email may contain one or more embedded emails, each of which can be extracted using the Chilkat mail component API. Attached messages typically occur in forwarded emails.

' Attached messages are complete emails embedded within another email.
' The Chilkat email component provides methods and properties for
' accessing attached messages.  This example demonstrates how to
' retrieve each attached email message and save each to a file.
Private Sub SaveAttachedMessages(email As ChilkatEmail2)

    Dim attEmail As ChilkatEmail2
    Dim filename As String
        
    fnameIdx = 0
    
    n = email.NumAttachedMessages
    For i = 0 To n - 1
        Set attEmail = email.GetAttachedMessage(i)
        
        ' Get the filename for this attached message
        ' (This may or may not be present, or you may decide not to use
        ' the embedded filename anyway...)
        filename = email.GetAttachedMessageFilename(i)
        If (Len(filename) = 0) Then
            fnameIdx = fnameIdx + 1
            filename = "email_" + Str(fnameIdx) + ".eml"
        End If
        
        ' Save to a .eml file.
        attEmail.SaveEml filename
        
        ' NOTE 1: Each attached message may itself contain other attached messages...
        ' NOTE 2: File attachments within an attached message are not included in the
        '         attachments for the outer email.
    Next
    
End Sub

 

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