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

 

 

 

 

 

 

 

Add Mail Attachments from In-Memory Strings

Download Chilkat Email ActiveX

Demonstrates adding email attachments directly from Visual Basic string variables.

' Attachments can be added directly from in-memory strings.
' This example demonstrates how it can be done...
Private Sub Command3_Click()

    ' Create an instance of the mailman for the purpose of unlocking.
    Dim mailman As New ChilkatMailMan2
    mailman.UnlockComponent "Anything for 30-day trial"
    
    ' Create a new email object...
    Dim email As New ChilkatEmail2
    email.Subject = "This is a test"
    email.Body = "This is the mail body"
    email.AddTo "Chilkat Support", "support@chilkatsoft.com"
    email.From = "Chilkat Sales <sales@chilkatsoft.com>"
    
    ' Add some XML file attachments directly from strings in memory.
    xml1 = "<company><name>Chilkat Software</name><industry>software</industry></company>"
    xml2 = "<food>pizza</food>"
    
    email.AddStringAttachment "company.xml", xml1
    email.AddStringAttachment "food.xml", xml2
    
    ' Let's review the MIME...
    MsgBox email.GetMime()
    
    ' We can send the email like this:
    mailman.SmtpHost = "smtp.comcast.net"
    success = mailman.SendEmail(email)
    If (success = 0) Then
        MsgBox mailman.LastErrorText
    Else
        MsgBox "Mail Sent!"
    End If
    
    
End Sub

 

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