GemBox.Email.Examples
GemBox.Email.Examples copied to clipboard
GemBox.Email is a .NET component that enables you to read, write, and convert email files (MSG, EML, and MHTML), or send and receive email messages (POP, IMAP, SMTP, and EWS) from .NET applications in...
What is GemBox.Email?
GemBox.Email is a .NET component that enables you to read, write, and convert email files (MSG, EML, and MHTML), or send and receive email messages (POP, IMAP, SMTP, and EWS) from .NET applications.
With GemBox.Email you get a fast and reliable component that's easy to use and doesn't depend on Microsoft Outlook. It requires only .NET so you can deploy your applications without having to think about other licenses.
GemBox.Email Features
- Create a mail message with attachments and a multi-format message body.
- Save and load mail messages to and from an MSG / EML / MHTML / MBOX file or a stream.
- Modify mail message headers using an advanced MIME model.
- List all mail messages using the POP protocol.
- Do custom SSL certificate validation when connecting to a mail server using PopClient, ImapClient, or SmtpClient.
- Create calendar events, tasks, reminders and add them to an email.
- Download a mail message using the POP or IMAP protocol.
- Send, list, and download messages on the Exchange Server using the EWS protocol.
- List and modify folders on the Exchange Server using the EWS protocol.
- Validate mail addresses.
- Perform a mail merge.
- Save and Load calendars in iCalendar format.
- Create and send mail messages using the SMTP protocol.
- List and modify folders on a mail server using the IMAP protocol.
- List and modify message flags using the IMAP protocol.
- Search for messages on a mail server using the IMAP protocol.
Get Started
You are not sure how to start working with email messages in .NET using GemBox.Email? Check the code below that shows how to create an email message from scratch and send it.
// If using Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
// Create a new email message.
MailMessage message = new MailMessage(
new MailAddress("[email protected]", "Sender"),
new MailAddress("[email protected]", "First receiver"),
new MailAddress("[email protected]", "Second receiver"));
// Add subject and body.
message.Subject = "Hello World!";
message.BodyText = "Hi 👋,\n" +
"This message was created and sent with GemBox.Email.";
// Create a new SMTP client and send the email message.
using (SmtpClient smtp = new SmtpClient("<ADDRESS> (e.g. smtp.gmail.com)"))
{
smtp.Connect();
smtp.Authenticate("<USERNAME>", "<PASSWORD>");
smtp.SendMessage(message);
}
For more GemBox.Email code examples and demos, please visit our examples page.
Installation
You can download GemBox.Email from NuGet 📦 or from BugFixes 🛠️.