SmtpMail.ImportHtmlBodyAsync Method

Imports html source from file or remote website to html body of the e-mail message.

[Visual Basic]
Public Sub ImportHtmlBodyAsync( _
    fileName As String, _
    options As ImportHtmlBodyOptions _
public void ImportHtmlBodyAsync(
    string fileName,
    ImportHtmlBodyOptions options
public: void ImportHtmlBodyAsync(
    String^ fileName,
    ImportHtmlBodyOptions^ options
public function ImportHtmlBodyAsync( 
    fileName : String,
    options : ImportHtmlBodyOptions* options


A full file name or URL.
Any combination of ImportHtmlBodyOptions values


[Visual Basic, C#, JavaScript] The following example demonstrates how to import remote & local html source with EASendMail SMTP Component. To get the full samples of EASendMail, please refer to Samples section.

[VB - Import Html Body and Embedded Image]
Dim oMail As SmtpMail = New SmtpMail("TryIt")

Await oMail.ImportHtmlBodyAsync( "", _ 
	ImportHtmlBodyOptions.ImportHttpPictures OR ImportHtmlBodyOptions.ImportCss )

Await oMail.SaveAsAsync( "ms-appdata:///local/google.eml", true )

Await oMail.ImportHtmlBodyAsync( "ms-appdata:///local/test.htm", _
	ImportHtmlBodyOptions.ImportLocalPictures OR ImportHtmlBodyOptions.ImportCss )

Await oMail.SaveAsAsync( "ms-appdata:///local/test.eml", true )

[C# - Import Html Body and Embedded Image]
SmtpMail oMail = new SmtpMail("TryIt");

await oMail.ImportHtmlBodyAsync( "", 
	ImportHtmlBodyOptions.ImportHttpPictures | ImportHtmlBodyOptions.ImportCss );

await oMail.SaveAsAsync( "ms-appdata:///local/google.eml", true );

await oMail.ImportHtmlBodyAsync( "ms-appdata:///local/test.htm", 
	ImportHtmlBodyOptions.ImportLocalPictures | ImportHtmlBodyOptions.ImportCss );

await oMail.SaveAsAsync( "ms-appdata:///local/test.eml", true );

[JavaScript - Import Html Body and Embedded Image]
var oMail = new EASendMail.SmtpMail("TryIt");

oMail.importHtmlBodyAsync( "", 
	EASendMail.ImportHtmlBodyOptions.importHttpPictures | EASendMail.ImportHtmlBodyOptions.importCss )

    return oMail.saveAsAsync( "ms-appdata:///local/google.eml", true );

    return oMail.importHtmlBodyAsync( "ms-appdata:///local/test.html", 
	EASendMail.ImportHtmlBodyOptions.importLocalPictures | EASendMail.ImportHtmlBodyOptions.importCss );

    return oMail.saveAsAsync( "ms-appdata///local/test.eml", true );

See Also

ImportHtmlBodyOptions Enumeration
Attachment Class
SmtpMail.ImportHtmlAsync Method
SmtpMail.HtmlBody Property