How to do a print preview page in 2.0

Posted on 2007-10-04
Last Modified: 2013-11-26
I am developing an email app and need to do a print preview page.

I have for example the message object

                     EmailMessage message = new EmailMessage();
                    message.ID = Guid.NewGuid();
                    message.Priority = 1;
                    message.EmailSubject = subject.Text;
                    message.EmailTo = row.Cells[3].Text;
                    message.EmailFrom = fromemail.Text;
                    message.EmailBCC = "";
                    message.EmailCC = copyto.Text;
                    message.EmailBody = ftb.Text;
                    message.Status = 0;
                    StringDictionary namevalue = GetPreparedNameValue(message);
                    EmailMessage templatedmessage = EmailTemplate.GetTemplatedMessage("GenericEmailTemplate", message, namevalue);

It uses a HTML template and I need the best way to do a "print preview" screenshot
Question by:mugsey
    LVL 21

    Expert Comment

    Do you want to send the screen shot of the page as a file in email??
    I do not understand what you are trying to do with a email component and a print preview.

    Author Comment

    I am  using my own mass emailer component and it is template driven.  I the user enters the BODY of the text and then I need to be able to preview the BODY and the header and footer templates
    LVL 21

    Expert Comment

    Are you generating a HTML mail or a text mail?
    Either ways you could just pass the HTML of the body with header and footer to another page to just display the HTML

    Author Comment

    Well the templates are of .txt extension.  How can I do this?
    LVL 21

    Accepted Solution

    After u get the template applied. MailMessage object should contain the header/ footer and the actual payload of the mail. You should be able to view it by passing the contents of MailMessage.Body to another page so the user may look at how it is going to display when the mail gets through.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now