Possible Duplicate:
confirming message before mailing in php
I am developing a page where in my boss will search for a company in a database. Once he clicks on its name, an email format will be shown (done in html) as a confirmation page. And then there will be a button (or link? i’m still not sure which to use) which will then send the mail to that particular company.
<img src="../../img/emmlogo.jpg" style="left: 0;position: absolute; width: 75px;"/>
<body style="padding: 0 0 0 100px;position: relative;">
<?php echo date("F d, Y ");?> <br><br>
<b> echo $row_Recordset1['First Name'].' '.$row_Recordset1['Middle Initial'].' '.$row_Recordset1['Last Name']; ?></b><br>
<?php echo $row_Recordset1 ['Position'].'<br>'.$row_Recordset1['Company Name'].'<br>'.$row_Recordset1['Corporate Address'];?><br><br>
<p>Dear <?php echo $row_Recordset1['Last Name']; ?>:</p>
I’ve only gotten to the confirmation page and it’s all set. I just want to find out if it is possible that I can send the information without having to repeat the queries from the confirmation page that I made and I want the mail to look exactly as how I made the html. I am open to any comments or suggestions as this site has helped me a lot in developing this particular project. thank you
First you should get rid of relative paths for your pictures if you intend on sending this HTML… provide links to servers that are accessible to everybody.
What you can do is send an HTML email (plenty of libraries already do that for you). If you want to reuse directly your confirmation page, consider the usage of
ob_startandob_end_clean. In between these two calls, query your script that generates the preview and dump it into a buffer usingob_get_contents. This should save you from writing the code twice.Here’s sample code from one of my project:
Helpful links: