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

 

 

 

 

 

 

Sending Email over SSL

Download: Chilkat .NET Assemblies

How to send email over SSL in C#

        // Sending email over a secure SSL connection.
        // Many SMTP servers accept secure SSL connections on port 465,
        // which is the de-facto standard port for SMTP SSL.
        // To send email using the Chilkat email component with SMTP SSL,
        // simply set the port number and indicate that SSL should be used
        // by setting the mailman.SmtpSsl property = true.
        private void button6_Click(object sender, EventArgs e)
        {
            Chilkat.MailMan mailman = new Chilkat.MailMan();
            mailman.UnlockComponent("anything for 30-day trial");

            mailman.SmtpHost = "smtp.comcast.net";

            // If your SMTP server requires authentication, set your username/password:
            mailman.SmtpUsername = "***";
            mailman.SmtpPassword = "***";

            // Indicate that the mail should be sent over SSL.
            mailman.SmtpSsl = true;
            // Use the SMTP SSL port 465.
            mailman.SmtpPort = 465;

            Chilkat.Email email = new Chilkat.Email();
            email.From = "Matt <matt@chilkatsoft.com>";
            email.Subject = "Subject for C# SSL mail programming sample";
            email.Body = "Body for C# SSL e-mail example code";
            email.AddTo("Email Component Help", "support@chilkatsoft.com");
            email.AddFileAttachment("something.pdf");

            // The SendEmail method will connect to the SMTP server
            // and negotiate an SSL connection.  All communications including
            // authentication occur over an SSL connection.
            bool success = mailman.SendEmail(email);
            if (!success)
            {
                MessageBox.Show(mailman.LastErrorText);
            }
            else
            {
                MessageBox.Show("Mail Sent!");
            }
        }

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.