SmtpMail.ImportTextBodyAsync Method

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

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


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


[Visual Basic, C#] 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 Email Text Body]
Dim oMail As SmtpMail = New SmtpMail("TryIt")
Await oMail.ImportTextBodyAsync( "", _ 
	ImportTextBodyOptions.ConvertHtmlToText )

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

Await oMail.ImportTextBodyAsync( "ms-appdata///local/test.txt", _
	ImportTextBodyOptions.NoOptions )

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

[C# - Import Email Text Body]
SmtpMail oMail = new SmtpMail("TryIt");
await oMail.ImportTextBodyAsync( "", 
	ImportTextBodyOptions.ConvertHtmlToText );

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

await oMail.ImportTextBodyAsync( "ms-appdata:///local/test.txt", _
	ImportTextBodyOptions.NoOptions );

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

[JavaScript - Import Email Text Body]
var oMail = new EASendMail.SmtpMail("TryIt");
oMail.importTextBodyAsync( "", 
	EASendMail.importTextBodyOptions.convertHtmlToText )
    return oMail.saveAsAsync( "ms-appdata:///local/google.eml", true );
    return oMail.importTextBodyAsync( "ms-appdata:///local/test.txt", _
	EASendMail.ImportTextBodyOptions.noOptions );
    return oMail.saveAsAsync( "ms-appdata///local/test.eml", true );

See Also

SmtpMail.TextBody Property
SmtpMail.ImportHtmlBodyAsync Method
SmtpMail.ImportHtmlAsync Method