Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6671321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:22:29+00:00 2026-05-26T03:22:29+00:00

Using ASP.NET … I have an email button on a popup extender and would

  • 0

Using ASP.NET…

I have an email button on a popup extender and would like to use the inner html of another aspx page to use for the body, then edit a couple tags before it is sent. Is this possible?

Basically I’m using the .Net.Mail.MailMessage to create an HtmlBody and want to grab the html of another page (without actually rendering the page) as opposed to recreating it in a string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:22:29+00:00Added an answer on May 26, 2026 at 3:22 am

    First of all creating html emails doesn’t allow for complicated html (internal,external styling, and other controls) see…

    Html Email Guidline.

    So what I did was use the following to create an html string for emailing…

    1) Create a simple .htm file as a template, formatting everything in standard html tables (not asp:tables), and other standard html tags.

    2) Only use in-line styling if necessary.

    3) Then create replacable text words or phrases to replace. You can also use a comment to replace text or for adding to a table see markup below

        <span style="font-size: 16px;">TodaysDate</span>
    
        <table id="PeopleTable" border="1" cellpadding="3" cellspacing="0" width="720">
            <tr style="font-weight: bold;">
                <td width="100">
                    First Name
                </td>
                <td width="100">
                    Last Name
                </td>
                <td width="100">
                    Phone Number
                </td>
            </tr>
            <!--AddRowsHere-->
        </table>
    

    4) Then from a button in code behind you need to get the .htm page as string and replace the text with values you want

     Using sr As New System.IO.StreamReader(Server.MapPath("PeoplePage.htm"))
            GetHtml = sr.ReadToEnd
     End Using
     GetHtml = Replace(GetHtml, "TodaysDate", Now.ToShortDateString)
    

    5) Return this string to the .Net.Mail.MailMessage.Body and send it out as you normally would. Make sure to set MailMesage.IsBodyHtml = True

    You could also create the entire string using StringBuilder without using a template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.NET MVC Preview 4 and would like to know how to use
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,
Using ASP.NET forms authentication, how would you accept an e-mail address and password, use
Using ASP.NET 3.5 ListView control. I would like to capture the value of my
Using asp.net, I need to generate a snapshot of an youtube video. I have
Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />
Using ASP.NET 3.5 and jQuery UI. When a user clicks the Search button, a
Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
Using ASP.NET MVC 2.0, I have an actionlink that is used for comments on
using ASP.NET MVC 1.0 and I have a action that returns a JsonResult and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.