cvs: pearweb /public_html account-mail.php
| From: | Martin Jansen | Date: | Fri, 13 Aug 2004 15:58:38 +0000 |
| Subject: | cvs: pearweb /public_html account-mail.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-22861@lists.php.net to get a copy of this message | ||
mj Fri Aug 13 11:58:38 2004 EDT
Modified files:
/pearweb/public_html account-mail.php
Log:
* Made it possible to optionally receive a copy of a message.
Bug: #2022.
http://cvs.php.net/diff.php/pearweb/public_html/account-mail.php?r1=1.11&r2=1.12&ty=u
Index: pearweb/public_html/account-mail.php
diff -u pearweb/public_html/account-mail.php:1.11 pearweb/public_html/account-mail.php:1.12
--- pearweb/public_html/account-mail.php:1.11 Tue Jun 22 00:00:37 2004
+++ pearweb/public_html/account-mail.php Fri Aug 13 11:58:38 2004
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: account-mail.php,v 1.11 2004/06/22 04:00:37 danielc Exp $
+ $Id: account-mail.php,v 1.12 2004/08/13 15:58:38 mj Exp $
*/
/**
@@ -41,7 +41,7 @@
// The first field that's empty
$focus = '';
- foreach (array('name', 'email', 'subject', 'text') as
$key) {
+ foreach (array('name', 'email', 'copy_me', 'subject',
'text') as $key) {
if (!isset($data[$key])) {
$data[$key] = '';
($focus == '') ? $focus = $key : '';
@@ -60,6 +60,9 @@
$form->addText('email', 'Email Address:',
$data['email'], 40, null, '',
$th, $td);
+ $form->addCheckBox('copy_me', 'Send me a copy of this mail:',
+ $data['copy_me'], '',
+ $th, $td);
$form->addText('subject', 'Subject:',
$data['subject'], 40, null, '',
$th, $td);
@@ -123,6 +126,15 @@
'-f pear-sys@php.net'))
{
report_success('Your message was successfully sent.');
+
+ if (!empty($_POST['copy_me'])) {
+ $text = "This is a copy of your mail sent to " . $row['email']
. ":\n\n" . $text;
+
+ @mail($_POST['email'], $_POST['subject'], $text,
+ 'From: "' . $_POST['name'] . '" <'
. $_POST['email'] . '>',
+ '-f pear-sys@php.net');
+ }
+
} else {
report_error('The server could not send your message, sorry.');
}