Re: email a html page
| From: | Naintara Jain | Date: | Tue, 16 Oct 2001 04:51:02 +0000 |
| Subject: | Re: email a html page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71171@lists.php.net to get a copy of this message | ||
Yes, it is possible.
Store the formatted data in a variable $msg.
And then
$recipient ="recipient@somewhere.com";
$subject ="Test mail";
$headers = "From: sender@somwhere.com\n;
$headers .= "Content-Type: text/html; charset=iso-8859-1";
mail($recipient, $subject, $msg, $headers);
This will send the email message (HTML format) stored in $msg across.
What you want to do is
1)
display formatted output
$msg=formatted output
email id?
Submit form.
2) On submit , send stored formatted output to the email id provided.
For this you must post the $msg data either as a hidden value or session value.
Then
$recipient ="recipient@somewhere.com";
$subject ="Test mail";
$headers = "From: sender@somwhere.com\n;
$headers .= "Content-Type: text/html; charset=iso-8859-1";
mail($recipient, $subject, $msg, $headers);
The
$headers .= "Content-Type: text/html; charset=iso-8859-1";
statement specifies that the email body will be in HTML format.
-Naintara
----- Original Message -----
From: "WebDev" <WebDev@merlepittman.com>
To: "php-general" <php-general@lists.php.net>
Sent: Tuesday, October 16, 2001 8:47 AM
Subject: [PHP] email a html page
Hi,
here is my problem:
I have a script that collect data from a database and generates a
formatted page using the data.
What I want to do is email that page (as html) to an address directly
from the browser. When the html is generated, just enter an email
address and send it off.
Any ideas?? Is this possible??
Thanks,
Merle
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net