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

 

 

 

 

 

 

 

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


 

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