C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C# Examples

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


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

SMTP Send Email in C#

Download: Chilkat .NET Assemblies

This is a simple example demonstrating how to send email via an SMTP server in C#.

	private void SendMail_Click(object sender, System.EventArgs e)
	{
		// Create a mailman object for sending email.
		Chilkat.MailMan mailman = new Chilkat.MailMan();
		mailman.UnlockComponent("unlockCode");

		mailman.SmtpHost = "smtp.earthlink.net";
		// The SMTP username and password are only necessary if
		// your SMTP server requires authentication.
		mailman.SmtpUsername = "myLogin";
		mailman.SmtpPassword = "myPassword";

		// Create an email object
		Chilkat.Email email = new Chilkat.Email();
		email.Subject = "This is the subject";
		email.Body = "This is the body";
		email.AddTo("John Smith","john.smith@chilkatsoft.com");
		email.From = "Chilkat Software <support@chilkatsoft.com>";

		// Send email in C#
		bool success = mailman.SendEmail(email);
		if (!success) 
		{
			mailman.SaveLastError("sendError.xml");
		}

	}

 

 

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