Link to home
Start Free TrialLog in
Avatar of Salah a a a Al Jasem
Salah a a a Al JasemFlag for Kuwait

asked on

How to get the currently displayed page text, tags, script ..... in a string to be used for email body

Asp.net
Vb.net

A page with a list of transaction is loaded
A textbox
A command button

The visitor enters the email in the textbox and clicks the command button, as a result the currently displayed page is sent to the entered email

How to get the currently displayed page text, tags, script .....      in a string to be used for email body

The code is

        Dim smtp As New System.Net.Mail.SmtpClient()
        Dim smail As New System.Net.Mail.MailMessage
        smail.To.Add(New System.Net.Mail.MailAddress(TextBox1.Text))
        smail.From = New System.Net.Mail.MailAddress("MyEmail@gmail.com", "subject")
        smail.Subject = "Subject"
        smail.IsBodyHtml = "true"
        smail.Body = (this part is needed)
        smtp.EnableSsl = True
        smtp.Send(smail)

Thanks
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

A page with a list of transaction is loaded into what a datagridview what? Can't read your mind here.
Avatar of Salah a a a Al Jasem

ASKER

It is a web page

by saying (is loaded) I am avoiding answers that sends email once the page is loaded.

I am trying so say,    the page is in front of the visitor with the following items

A classic table with a list of transaction
A textbox
A command button

I need to get all tags and text in the page (as is) to be used in the email body

right now I am redesigning the body, which is not a good way

Thanks for trying to help
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have tried you solution and I get the following Compile error

 BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types

On the following line

Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
sorry the last reply from me was not right

Mr. Ark Your code is working perfect
Thank you Mr. David
Thank you Mr. Ark

For helping me