Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
VB to Convert Web Page into HTML Email and Send This Visual Basic example program downloads a Web Page, converts it into an HTML email, and sends it. ' Visual Basic program to convert a Web page into an HTML email and send.
Private Sub Command1_Click()
Dim mht As New ChilkatMHT
mht.UnlockComponent "MhtUnlockCode"
Dim email As New ChilkatEmail2
Set email = mht.GetEmail("http://www.google.com/")
' Save it as an EML file
' The email is part of the Chilkat Mail component, so we must unlock it.
Dim mailman As New ChilkatMailMan2
mailman.UnlockComponent "MailUnlockCode"
' The email subject is automatically initialized to the title of the
' Web page, so we'll change it here.
email.Subject = "Google Home Page"
' We can save the email to EML for use by Outlook Express.
email.SaveEml "google.eml"
' Set our SMTP host, and add a recipient to the email.
mailman.SmtpHost = "mail.earthlink.net"
success = email.AddTo("Chilkat Support", "support@chilkatsoft.com")
' Sent the HTML email.
email.FromName = "Chilkat MHT"
email.FromAddress = "mht@chilkatsoft.com"
success = mailman.SendEmail(email)
mailman.SaveLastError "mailLog.xml"
mht.SaveLastError "mhtLog.xml"
End Sub
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.