VB.NET Examples

ChilkatHOMEAndroid™Classic ASPCC++C#C# WinRTDelphi ActiveXDelphi DLLVisual FoxProJavaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerShellPythonRubySQL ServerUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET WinRTVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
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...
Amazon S3
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

 

 

 

 

 

 

VB.NET Send Email

Download: Chilkat .NET Assemblies

VB.NET sample program showing how to send email.

    ' VB.NET Send Email
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        ' Create a mailman to send email.
        Dim mailman As New Chilkat.MailMan()
        mailman.UnlockComponent("UnlockCode")

        ' Set your SMTP server hostname.
        mailman.SmtpHost = "smtp.earthlink.net"

        ' You may need these depending on your SMTP server.
        'mailman.SmtpUsername = "username"
        'mailman.SmtpPassword = "password"

        ' Create the email.
        Dim email As New Chilkat.Email()
        email.Subject = "This is a test"
        email.Body = "This is a test"
        email.AddTo("Chilkat Support", "support@chilkatsoft.com")
        email.AddCC("Bill Johnson", "bill@mjapanese.com")
        email.FromAddress = "matt@chilkatsoft.com"
        email.FromName = "Matt"

        ' Add an attachment
        If (email.AddFileAttachment("dude.gif") Is Nothing) Then
            MsgBox(email.LastErrorText)
        End If

        ' Send email.
        If (Not mailman.SendEmail(email)) Then
            MsgBox(mailman.LastErrorText)
        Else
            MsgBox("Email Sent!")
        End If

    End Sub


Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 
 

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