VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
PFX
RSA Encryption
S/MIME
Socket
Spider
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Byte Array
VB.NET FTPS
System.IO

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

Send Email with Progress Monitoring

Send an email in VB.NET with progress monitoring.

Download Chilkat .NET for 2.0 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework


    ' If we want to use events, we must declare the mailman as a member of the class.
    Private WithEvents mailman As New Chilkat.MailMan()

    ' This is the event callback.
    Private Sub mailman_OnSendPercentDone(ByVal sender As Object, ByVal args As Chilkat.MailPercentDoneEventArgs) Handles mailman.OnSendPercentDone
        ' args.PercentDone is an integer value indicating the percent done (1 to 100)

        ' args.Abort is an output argument.  If we set it to True the mail sending will
        ' be aborted.  In this example, we'll abort after the mail is 50% sent...
        ProgressBar1.Value = args.PercentDone
        If (args.PercentDone >= 50) Then
            args.Abort = True
        End If
    End Sub
    
' The VB.NET IDE will automatically create the "mailman_OnSendPercentDone" method
' if you select the "mailman" object and then the "SendPercentDone" event as shown here:

      
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


'  Any string argument automatically begins the 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent("30-day trial")
If (success <> true) Then
    MsgBox("Component unlock failed")
    Exit Sub
End If


'  Make sure that events are enabled on the mailman:
mailman.EnableEvents = true

'  Set the SMTP server.
mailman.SmtpHost = "smtp.comcast.net"

'  Create a new email object
Dim email As New Chilkat.Email()

email.Subject = "This is a test"
email.Body = "This is a test"
email.From = "Chilkat Support <support@chilkatsoft.com>"
email.AddTo("TagTooga","admin@tagtooga.com")

success = mailman.SendEmail(email)
If (success <> true) Then
    MsgBox(mailman.LastErrorText)
Else
    MsgBox("Mail Sent!")
End If

End Sub

 

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

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

Mail Component · XML Parser