Chilkat HOME Android™ ASP Visual Basic VB.NET C# iOS (IPhone) Objective-C C++ C Unicode C++ Unicode C MFC Delphi DLL Delphi ActiveX FoxPro Java Perl PHP Extension PHP ActiveX Python PowerShell Ruby SQL Server VBScript
Sending Email over SSLDownload: 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 |
© 2000-2013 Chilkat Software, Inc. All Rights Reserved.