Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

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

More Examples...
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA


VB Strings
VB Byte Array

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

 

Background Mail Sending using SMTP Queue

Download Chilkat Email ActiveX

This example shows how to send asynchronous email in the background using the SMTP Queue service.

' Send mail in the background using the SMTP Queue service
Private Sub Command1_Click()

    Dim mailman As ChilkatMailMan2
    Set mailman = New ChilkatMailMan2
    
    ' Anything will begin the 30-day trial.
    mailman.UnlockComponent "UnlockCode"

    mailman.SmtpHost = "smtp.earthlink.net"
    
    ' Only set username/password if your SMTP server requires a logon.
    'mailman.SmtpUsername = "your_username"
    'mailman.SmtpPassword = "your_password"
    ' Only set the login domain if your SMTP server uses integrated Windows authorization
    ' AND it is part of a domain.
    'mailman.SmtpLoginDomain = "your_domain"
    
    ' How do I send an email with an attachment?
    Dim email As ChilkatEmail2
    Set email = New ChilkatEmail2
 
    email.AddTo "Chilkat Support", "support@chilkatsoft.com"
    
    email.Subject = "Test of sending queued mail from VB using the SMTP queue"
    email.Body = "This email was sent from Visual Basic using the SMTP queue service"
    
    email.FromName = "Matt"
    email.FromAddress = "matt@chilkatsoft.com"
    'email.ReturnReceipt = 1
    
    ' Add a file attachment.
    Dim contentType As String
    contentType = email.AddFileAttachment("sample.jpg")
    
    ' To send encrypted and/or signed emails, just set these flags.
    'email.SendEncrypted = 1
    'email.SendSigned = 1
    Dim success As Long
    
    success = mailman.SendQ(email)
    Label1.Caption = "Success: " & Str(success) & vbCrLf
    
    If (success = 0) Then
        ' Failed.
        MsgBox mailman.LastErrorText
    End If
    
    
End Sub


 

Need a specific example? Send a request to support@chilkatsoft.com

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