ImportMail Method


Import a file or URL to BodyText.

[Syntax]
Visual C++: HRESULT ImportMail( BSTR FileName, long* pVal )
Visual Basic: ImportMail( strFile As FileName ) As Long

Parameters

FileName
Valid file with full path or URL.

Return Values

Return zero if successful, or return non-zero if failed.

Example

[Visual Basic, Delphi] 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.

[VB6, VBA - Import Text Body]
Private Sub btnSendMail_Click()
  Dim oSmtp As New EASendMailObjLib.Mail
  oSmtp.LicenseCode = "TryIt"
  
  oSmtp.ImportMail "http://google.com"
  oSmtp.SaveMail "c:\google.eml"  

  oSmtp.ImportMail "c:\test.txt"
  oSmtp.SaveMail "c:\test.eml" 

End Sub
 
[Delphi - Import Text Body]
Procedure TForm1.Button1Click(Sender: TObject);
var:
  oSmtp: TMail;
begin
  oSmtp := TMail.Create(Application);
  oSmtp.LicenseCode = 'TryIt'
  
  oSmtp.ImportMail( 'http://google.com' );
  oSmtp.SaveMail( 'c:\google.eml' );

  oSmtp.ImportMail( 'c:\test.txt' );
  oSmtp.SaveMail( 'c:\test.eml' );

 end;

See Also

ImportHtml Method
ImportMailEx Method
BodyText Property