Mail form- HELP!
Moderator: General Moderators
Mail form- HELP!
Quick to the chase:
I am developing a website for a client, and he wants a mail form where folks can "send this page to a friend". I have that part up and running, but here's the rub:
The clinet wants each message CCd to his e-mail address. I have NO idea of how to do this.
The page is here:
http://www.governorgirlieman.com/mail.html
and the PHP script is here:
http://www.governorgirlieman.com/sendurl.php
(just go to those pages, and "view source")
Can anyone here PLEASE help me out, on this?
I have spent six hours looking all over the web, and other forums, for such information, but none of it is of any use. I'm new to PHP, and it's incomprehensible to me.
Thanks much, for any help you can provide.
I am developing a website for a client, and he wants a mail form where folks can "send this page to a friend". I have that part up and running, but here's the rub:
The clinet wants each message CCd to his e-mail address. I have NO idea of how to do this.
The page is here:
http://www.governorgirlieman.com/mail.html
and the PHP script is here:
http://www.governorgirlieman.com/sendurl.php
(just go to those pages, and "view source")
Can anyone here PLEASE help me out, on this?
I have spent six hours looking all over the web, and other forums, for such information, but none of it is of any use. I'm new to PHP, and it's incomprehensible to me.
Thanks much, for any help you can provide.
Here is example from php_manual
Code: Select all
<?php
/* recipients */
$to = "mary@example.com" . ", " ; // note the comma
$to .= "kelly@example.com";
/* subject */
$subject = "Birthday Reminders for August";
/* message */
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n";
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";
$headers .= "Cc: birthdayarchive@example.com\r\n";
/*
$headers .= "Cc: ".$ccemailaddress."\r\n";
*/
$headers .= "Bcc: birthdaycheck@example.com\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
?>
Last edited by PanK on Wed Nov 24, 2004 1:59 pm, edited 1 time in total.
Doesn't work- please help, again
Tried the script- doesn't work. I get the error:
Parse error: parse error, unexpected T_VARIABLE in /home/content/j/o/h/johnredgell/html/mail2.php on line 1
when it is posted.
You can view it at:
http://www.governorgirlieman.com/mail2.php
Again-
I urge you to PLEASE look at the URLs in my previous post:
http://www.governorgirlieman.com/mail.html
and
http://www.governorgirlieman.com/sendurl.php
Is there no way that a simple line of script can be added to the existing code?
thanks.
Parse error: parse error, unexpected T_VARIABLE in /home/content/j/o/h/johnredgell/html/mail2.php on line 1
when it is posted.
You can view it at:
http://www.governorgirlieman.com/mail2.php
Again-
I urge you to PLEASE look at the URLs in my previous post:
http://www.governorgirlieman.com/mail.html
and
http://www.governorgirlieman.com/sendurl.php
Is there no way that a simple line of script can be added to the existing code?
thanks.
No, I didn't.
No, I didn't- I used the script you have, above, word-for-word, character-for-character.
There's gotta be a way to do this.
I appreciate your help- this is driving me insane- I've spent a cumulative 20 hours, trying to figure this out, and like I said, PHP is about as supple and flexible as a three-foot-thick railroad tie.
There's gotta be a way to do this.
I appreciate your help- this is driving me insane- I've spent a cumulative 20 hours, trying to figure this out, and like I said, PHP is about as supple and flexible as a three-foot-thick railroad tie.
code cut and pasted from previous discussion
<?php
/* recipients */
$to = "mary@example.com" . ", " ; // note the comma
$to .= "kelly@example.com";
/* subject */
$subject = "Birthday Reminders for August";
/* message */
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n";
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";
$headers .= "Cc: birthdayarchive@example.com\r\n";
$headers .= "Bcc: birthdaycheck@example.com\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
?>
?>
/* recipients */
$to = "mary@example.com" . ", " ; // note the comma
$to .= "kelly@example.com";
/* subject */
$subject = "Birthday Reminders for August";
/* message */
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n";
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";
$headers .= "Cc: birthdayarchive@example.com\r\n";
$headers .= "Bcc: birthdaycheck@example.com\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
?>
?>
there is no parse error in that code you posted.
are you sure you are posting the ENTIRE file? dont leave anything out. post it all.
and please use
are you sure you are posting the ENTIRE file? dont leave anything out. post it all.
and please use
Code: Select all
tags when posting so it is formattedThat's the code I have on the page.
I cut and pasted that code into notepad, and saved it as a PHP document, and uploaded it.
It can be viewed, again, at:
http://www.governorgirlieman.com/mail2.php
-any suggestions?
It can be viewed, again, at:
http://www.governorgirlieman.com/mail2.php
-any suggestions?
Doesn't ANYONE here have a solution?
Other than someone sending me scripts that don't work? Please read first post for details.
-thanks!
-thanks!
Nice question
A tiny bit- I've spent about 20 hours messing about with it, the past three days, and it makes absolutely no sense to me.
That's why I came here- I just needed a bit of guidance.
I appreciate you givig me some script- but I have no idea of what to do with it- as I said, PHP is about as flexible as a three-foot-wide railroad tie, and I only have a rudimentary understanding.
That's why I posted the PHP and HTML pages I have currently constructed. I was hoping someone could point out to me something VERY simple: How to add a CC command into the existing script.
If you want me to admit I'm clueless- well- here you go:
I'M CLUELESS- I'M A MORON WHO KNOWS NADA ABOUT PHP! If you want, I can hop on one foot naked in the public square, while yelling the previous.
Now, can you give me a tad of help, here? I thought that's what this forum was for.
-thanks.
-eric
That's why I came here- I just needed a bit of guidance.
I appreciate you givig me some script- but I have no idea of what to do with it- as I said, PHP is about as flexible as a three-foot-wide railroad tie, and I only have a rudimentary understanding.
That's why I posted the PHP and HTML pages I have currently constructed. I was hoping someone could point out to me something VERY simple: How to add a CC command into the existing script.
If you want me to admit I'm clueless- well- here you go:
I'M CLUELESS- I'M A MORON WHO KNOWS NADA ABOUT PHP! If you want, I can hop on one foot naked in the public square, while yelling the previous.
Now, can you give me a tad of help, here? I thought that's what this forum was for.
-thanks.
-eric
Well, it doesn't work, here.
In fact, if you go to the page where it's posted, now, and "view source", you get a blank.