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