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

 

 

 

 

 

 

Add VB.NET Code to Send Mail

Add a button to the form, rename the button "SendEmail" and double-click it to edit the code for the button click event. Add the following code:

    Private Sub SendEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendEmail.Click


        Dim mailman As New Chilkat.MailMan()
' Any string passed to UnlockComponent begins a 30-day trial. mailman.UnlockComponent("anything") mailman.SmtpHost = "smtp.earthlink.net" Dim email As New Chilkat.Email() email.Subject = "This is the subject" email.Body = "This is the body" email.AddTo("Chilkat Support", "support@chilkatsoft.com") email.From = "John Smith john.smith@chilkatsoft.com" If (Not mailman.SendEmail(email)) Then MsgBox(mailman.LastErrorXml) Else MsgBox("Mail Sent!") End If End Sub


Compile, run, and check your email.

Notes

  • The Chilkat classes are contained in the "Chilkat" namespace.
  • For a complete reference, see Chilkat .NET Class Reference
  • Do not forget to change the SMTP server name and to/from addresses in the source.
  • If the send mail fails, the error information will be found in ErrorLog.xml, which is located in the same directory as your application executable (in this example).

Back To Step2

 

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

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

Mail Component · XML Parser