Sending and Forwarding Messages

Sending Emails

The SmtpClient class provided by Aspose.Email for Java API allows sending email using the Simple Mail Transfer Protocol (SMTP).

  • The SmtpClient class is the only major entry developers use to send mail messages.
  • The SmtpClient class also provides other common email delivery methods, including writing email messages to the file system, message queue, etc.
  • The SmtpClient class also supports sending messages as TNEF.
  • It allows sending emails via non-SSL as well as SSL enabled servers.

This article shows how to use the SmtpClient class to send email messages.

Sending Meeting Request

Aspose.Email for Java API already allows working with Appointments/meetings such as creating an appointment, formatting and saving it to disc and add as well as retrieve attachments from these. With the API’s SmtpClient, these meeting requests can be sent out to the recipients similar to Microsoft Outlook. This article shows how to send a meeting request using the API’s SmtpClient.

Sending Emails with MultiConnection

SmtpClient provides a UseMultiConnection property which can be used to create multiple connections for heavy operations. You may also set the number of connections to be used during multiconnection mode by using SmtpClient.ConnectionsQuantity. The following code snippet demonstrates the use of the multiconnection mode for sending multiple messages.

Forwarding Emails using SMTP Client

Forwarding Email

Forwarding an email is common practice in daily life digital communication. An email received can be forwarded to specific recipients without sharing with the original senders. Aspose.Email API’s SmtpClient provides the capability to forward an email to specific recipients. Its forward method can be used to forward a received or saved email to desired recipients as shown in this article.

Forwarding Email Without Loading using MailMessage

In certain cases, a system may be low on resources like Memory. Using MailMessage, in such scenarios, can lead to problems before sending via Smtp client. The API provides the capability to send email messages without loading it using MailMessage instance. Following sample code illustrates the usage of this feature.