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

 

 

 

 

 

 

Customizing X-Mailer

Download: Chilkat .NET Assemblies

How to set the X-Mailer header field for email in C#.

        // The X-Mailer header field is used to describe the software that sends an email.
        // By default, because you are using the Chilkat email component, the X-Mailer field
        // is initialzed to a string that indicates that Chilkat's mail component is
        // the software behind the mail.
        // You can easily override this by setting the X-Mailer header field...
        private void button8_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 login/password:
            mailman.SmtpUsername = "***";
            mailman.SmtpPassword = "***";

            Chilkat.Email email = new Chilkat.Email();
            email.From = "Matt <matt@chilkatsoft.com>";
            email.Subject = "Subject for X-Mailer programming sample";
            email.Body = "Body for X-Mailer example code";
            email.AddTo("Email Component Support", "support@chilkatsoft.com");

            // Chilkat provides the Mailer property that maps to the X-Mailer header field.
            email.Mailer = "My Cool Application (http://www.mycoolapp123.com)";

            // You could just as well set the X-Mailer field by calling AddHeaderField, which
            // replaces an email header if it already exists:
            email.AddHeaderField("X-Mailer", "My Cool Application (http://www.mycoolapp123.com)");
            
            // Now when you send email, your application is the mailer....
            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.