Emailing the Contents of a Page

Updated June 5, 2006
Iron Speed Designer V3.2 and V4.0

If you want to email the contents of a page to a user, you will need to execute the URL, receive the response from the server and email this response.  To do this, you can use a utility function provided in your application classes to execute the URL and receive its response.  Here is an example of how you can do it.

Visual Basic .NET:

Imports BaseClasses.Utils

 

Public Sub EmailPage()

     Dim content As String

     Try

          ' execute a URL and receive the HTML content as a string

          content = NetUtils.ExecuteUrl("http://www.ironspeed.com?id=1")

 

          ' compose a message with this content.

          Dim email As New BaseClasses.Utils.MailSender

          email.AddFrom("sales@ironspeed.com")

          email.AddTo("support@ironspeed.com")

          email.SetSubject("This is the subject")

          email.SetContent(content)

          email.SetIsHtmlContent(True)

 

          'Send the email

          email.SendMessage()

     Catch ex As Exception

           ' handle error situations here

     End Try

End Sub

See Also

Email Integration