HtmlMessage Class | Programming with FireMail for .NET

Language

Visual Basic

C#

Show All

An HtmlMessage class in FireMail represents a MIME message which consist of HTML body and an alternative body in plain text. The alternative part is optional and is widely used to make compatibility for clients who do not have options for viewing HTML.

Similarly, this message can also hold embedded files like images or sound. This can be done by adding those files to the HtmlAttachment and making use of Cid or Content Base and Content Location.

Below is an example of creating an HtmlMessage.

[Visual Basic]
' Create a Html Text Message 
Dim message As HtmlMessage =  New HtmlMessage("Full Name","from@company.com") 
 
' Add recipients
message.To.Add("Full Name", "to@company.com")
 
' Assign subject & Body
message.Subject = "HtmlMessage Example"
message.Body = " Hai , A test message using FireMail."
message.AltBody = "Hai \r\n\t A test message using FireMail."
 
' Send the message
message.Send("localhost")                                 
[C#]
// Create a Html Message 
HtmlMessage message = new HtmlMessage( "Full Name", "from@company.com" );
// Add recipients
message.To.Add( "Full Name", "to@company.com" );
// Assign subject & Body
message.Subject = "HtmlMessage Example";
message.Body = " Hai , A test message using FireMail.";
message.AltBody = "Hai \r\n\t A test message using FireMail.";
// Send the message
message.Send( "localhost" );

See Also 

HtmlMessage Class | Programming with FireMail for .NET