VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

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

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

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

STARTTLS Send E-Mail Sample Code

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

Sending email over a secure channel using STARTTLS is identical to sending email w/out STARTTLS. The only difference is that we set the mailman.StartTLS property = true. When the mailman sends email, it will first connect to the SMTP server via the normal unsecure port 25. It will then issue a STARTTLS command to make the channel secure, login, and send the email. Both the login (if necessary) and mail sending are over the secure channel.

        Dim mailman As New Chilkat.MailMan()

        ' Any string passed to UnlockComponent automatically begins a 30-day trial.
        Dim success As Boolean
        success = mailman.UnlockComponent("Hello World")
        If (success <> true) Then
            MsgBox(mailman.LastErrorText)
            Exit Sub
        End If

        mailman.SmtpHost = "smtp.comcast.net"
        mailman.StartTLS = True

        Dim email As New Chilkat.Email
        email.AddTo("Chilkat Support", "support@chilkatsoft.com")
        email.AddTo("Chilkat Sales", "sales@chilkatsoft.com")
        email.From = "Matt Fausey <fausey@chilkatsoft.com>"

        email.Subject = "This is a test"
        email.SetHtmlBody("<html><body><h1>This is a test</h1><p>Hello World!</p></body></html>")

        success = mailman.SendEmail(email)

        If (Not success) Then
            MessageBox.Show(mailman.LastErrorText)
        Else
            ' Show the LastErrorText anyway, because is will include
            ' informational messages and we can verify for testing that the
            ' StartTLS actually happened.
            ' You will see this message: "Error authenticating server credentials",
            ' which can be ignored.
            MessageBox.Show(mailman.LastErrorText)
        End If




 

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

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

Mail Component · XML Parser