C# Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

C# Examples

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


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

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

 

 

 

 

 

 

Add C# 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 void SendEmail_Click(object sender, System.EventArgs e)
		{
			Chilkat.MailMan mailman = new Chilkat.MailMan();
// Any string begins a 30-day trial. mailman.UnlockComponent("anything-here-for-30-day-trial"); mailman.SmtpHost = "smtp.earthlink.net"; Chilkat.Email email = 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 (!mailman.SendEmail(email)) { mailman.SaveLastError("ErrorLog.xml"); } }


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-2008 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser