Creating Response emails with PHP (??)

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
shawoody
Posts: 13
Joined: Wed Jul 06, 2005 5:30 pm

Creating Response emails with PHP (??)

Post by shawoody »

Script URL: http://www.woodyshaw.com/gbook132/gbook.php
Version of script: 1.3.2
Version of PHP: 4
Hosting company: GoDaddy
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: everything!

Write your message below:

What would the PHP code be for making it so that people who leave entries receive a customized email?

Anyone...?
FruitBeard

Replying to guest book signers

Post by FruitBeard »

Hi, here is how to do it, you may want to alter various things yourself.

search gbook code for this string:

if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$message = "Hello!

Someone has just signed your Guest book!

Name: $name
From: $from
E-mail: $email
Website: $url

Message (without smileys):
$comments_nosmileys


Visit the below URL to view your Guest book:
$settings[gbook_url]

End of message
";

mail("$settings[admin_email]","Guest book Signature",$message);

}

and replace with:


if ($settings['notify'] == 1)
{
$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$message2 = "Hello $name, thank you for signing my guestbook.";
$message = "Hello!

Someone has just signed your Guest book!

Name: $name
From: $from
E-mail: $email
Website: $url

Message (without smileys):
$comments_nosmileys


Visit the below URL to view your Guest book:
$settings[gbook_url]

End of message
";

mail("$settings[admin_email]","Guest book Signature",$message);
mail("$email","Shawoody's Guest Book signature verification",$message2);
}

i tested it and got sent a reply, so it works, just mess around with your reply statement.

:wink:
Guest

Post by Guest »

a simplified version

find:


mail("$settings[admin_email]","Guest book Signature",$message);

AND REPLACE WITH


$message2 = "Hello $name, thank you for signing my guestbook.";

mail("$settings[admin_email]","Guest book Signature",$message);
mail("$email","Shawoody's Reply",$message2);

:wink:
Guest

Post by Guest »

Hello me again,

they will only get a reply email if an email is supplied,

as funny as it sounds its true, lol

like the old jazz thing you got going on 8)
FruitBeard

Automated email reply

Post by FruitBeard »

Hi shawoody, remember ti said do the below, which does work, but you wanted to have it say who the reply was from:

ok undo the code given yesterday, as below remove the two bold lines


$message2 = "Hello $name, thank you for signing my guestbook.";

mail("$settings[admin_email]","Guest book Signature",$message);
mail("$email","Shawoody's Reply",$message2);

now insert this


mail("$settings[admin_email]","Guest book Signature",$message);
mail("$email","Shawoody's Automated Response. Thank You.",
"Hi, $name
Thank You for Your interest in $settings[website_url]
You left the following information.
------------------------------
Name : $name
Email : $email
From : $from

You commented:
------------------------------
$comments_nosmileys

------------------------------
Regards, Shawoody
$settings[website_url]","FROM:$settings[admin_email]");

end code

if you have problems following that i can help you

:shock:
Post Reply