Page 1 of 2
Mail form- HELP!
Posted: Wed Nov 24, 2004 1:35 pm
by eblumrich
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.
Posted: Wed Nov 24, 2004 1:40 pm
by PanK
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);
?>
Doesn't work- please help, again
Posted: Wed Nov 24, 2004 1:52 pm
by eblumrich
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.
Posted: Wed Nov 24, 2004 2:02 pm
by PanK
Parse error - syntax erorr. there was ?> ?> at the end. Did you remove one?
No, I didn't.
Posted: Wed Nov 24, 2004 2:06 pm
by eblumrich
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.
Posted: Wed Nov 24, 2004 2:15 pm
by PanK
Show your code.
code cut and pasted from previous discussion
Posted: Wed Nov 24, 2004 2:17 pm
by eblumrich
<?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);
?>
?>
Posted: Wed Nov 24, 2004 2:21 pm
by PanK
That's the code I gave you. What do you have right now in your page?
Posted: Wed Nov 24, 2004 2:23 pm
by rehfeld
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
Code: Select all
tags when posting so it is formatted
That's the code I have on the page.
Posted: Wed Nov 24, 2004 2:25 pm
by eblumrich
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?
Doesn't ANYONE here have a solution?
Posted: Wed Nov 24, 2004 3:32 pm
by eblumrich
Other than someone sending me scripts that don't work? Please read first post for details.
-thanks!
Posted: Wed Nov 24, 2004 3:45 pm
by PanK
Do you know anything about PHP?
Posted: Wed Nov 24, 2004 3:46 pm
by rehfeld
the code he posted WORKS
for one, i tried it.
two- its right from the php manual. thus i tend to think it is your error.
Nice question
Posted: Wed Nov 24, 2004 3:51 pm
by eblumrich
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
Well, it doesn't work, here.
Posted: Wed Nov 24, 2004 3:52 pm
by eblumrich
In fact, if you go to the page where it's posted, now, and "view source", you get a blank.