0

How do I capture a webpage as an image and send it embedded in an email.

This is what I want to do.

Users are logged on this website. They will be browsing many products, when they click on the email button the webpage containing the list of products will be captured and send to their email address embedded in the body of the email.

Technology I would like to use: C# .net

The customers' information is stored in a SQL server database.

I have been experimenting with web browser control, but I don't know if that will work.

user385599
  • 25
  • 1
  • 8

2 Answers2

0

Is it important that the "capture" is actually a physical image or is the content of the order what's most important? If you can send the content of the order, i.e. the order lines, you can just put the exact same HTML as you output in the browser in the e-mail you would like to send, using the MailMessage class:

using (MailMessage message = new MailMessage("from@example.com", "to@example.com"))
{
    message.Subject = "Your order";
    message.Body = "<ul><li>Your</li><li>Order</li><li>Lines</li><li>Here</li></ul>";
    message.IsBodyHtml = true;

    using (SmtpClient smtp = new SmtpClient("smtp.host.example"))
    {
        smtp.Send(message);
    }
}
Asbjørn Ulsberg
  • 8,721
  • 3
  • 45
  • 61
  • Thank you for your answer. I will not be able to continue work on this for now as I need to focus on a higher priority project for now. – user385599 May 08 '12 at 23:14
  • The issue is, how do i create an application that would capture the screen and email to the customer. – user385599 May 18 '12 at 02:15
  • @user385599, why do you need to capture the screen? What is it about the rendered pixels that are so important that the exact same HTML won't do? – Asbjørn Ulsberg May 21 '12 at 06:23
0

You can capture the webpage as a quality image with a screenshot extension from the chrome web store that can be installed for free. You will be able to capture either the visible screen, full-page or custom area capture within a few clicks. Once the image has been captured, you can save it as a PDF or PNG and then use the saved image to be sent over by mail to the concerned party.

One such tool you can use could be the Goscreenshotting - Screenshotting extension which can help you save screenshots in multiple ways and formats to be shared over mail or any other medium.

You can also capture the webpage with the stock app on Windows - Snipping tool. But this will only allow for visible screen and custom area snips and not the full screen capture. If you are using Mac OS, you will be able to capture the screen with the following shortcuts :

  • Command + Shift + 3
  • Command + Shift + 4
  • Command + Shift + 5