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
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Byte Array
VB.NET FTPS
System.IO

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

STARTTLS Send E-Mail Sample Code

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()
        mailman.UnlockComponent("Anything for 30-day trial")

        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>")

        Dim success As Boolean
        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-2007 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser