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 7735465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:30:32+00:00 2026-06-01T07:30:32+00:00

i have an html email being generated by certain php functions and collected from

  • 0

i have an html email being generated by certain php functions and collected from several tables in the database and organized in an html layout..right now it is all in a preview.php page for testing the layout but when i need to send it to subscribers, i need to get the html code generated from this page only,and send that code in an email.and i mean by page source the one i see when i right click on the page and then click view source..so how do i get this page source ? or save it into a certain variable to use it ?

  • 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-06-01T07:30:33+00:00Added an answer on June 1, 2026 at 7:30 am

    Option 1:

    Use file_get_contents(), since it returns the file in a string:

    $html = file_get_contents('preview.php')

    Your whole html is now saved in the $html variable as a string.

    Option 2:

    If your preview.php contains some PHP processing, you can do this instead (so that the PHP codes get executed, and you still get the resulting html):

    ob_end_clean();
    ob_start();
    include('preview.php');
    $html = ob_get_contents();
    ob_end_clean();
    

    Again, your whole html is now saved in the $html variable as a string.

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

Sidebar

Related Questions

I have this code snippet in an email layout: <div> <?php echo $this->Html->image('Layouts/default/Logo.png', array(
I have an HTML table with one column being email addresses; spambot issues aside,
Say I have an HTML form like this to collect an email from a
I have an HTML form, being submitted to a PHP page. The PHP page
I have two templates for my HTML email: one for bigger screens, and one
Is there some sort of formatting protocol for html email? We have an automated
I have an application that sends an HTML formatted email with embedded images. The
I have a couple of simple forms that send an html-only email. Most clients
I have email addresses encoded with HTML character entities. Is there anything in .NET
We have to convert EVERYTHING to images for archiving purpose. DOC, HTML, email, ZIP,

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.