Skip to content Skip to sidebar Skip to footer

Confirmation Page Before Mailing In Php

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 emai

Solution 1:

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_start and ob_end_clean. In between these two calls, query your script that generates the preview and dump it into a buffer using ob_get_contents. This should save you from writing the code twice.

Here's sample code from one of my project:

ob_start(); // turn on output buffering
require("mails/email_preview.php"); // include, require, process whatever you want to fill the buffer with
$_body=ob_get_contents(); // get the content of the buffer
ob_end_clean(); // erase the buffer and turn off output buffering

$this->sendMail($_emailAddress, "Email Title", $_body);

Helpful links:


Post a Comment for "Confirmation Page Before Mailing In Php"