Page 1 of 1

Creating Response emails with PHP (??)

Posted: Tue Jul 19, 2005 9:01 pm
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...?

Replying to guest book signers

Posted: Tue Jul 19, 2005 11:16 pm
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:

Posted: Tue Jul 19, 2005 11:28 pm
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:

Posted: Tue Jul 19, 2005 11:41 pm
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)

Automated email reply

Posted: Wed Jul 20, 2005 10:12 am
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: