Try something to make sure your $email and $name variables are passed correctly (add some debug statements to print them). Not sure if you did this or if you are checking if the form has been posted or not. But this will be the first step.
From my work with PHPMailer and GMail they do not work well. Instead, I would suggest trying the phpGMailer script. It is great for GMail. See if this fixes your problems.
UPDATE
Thinking about this, I donβt think GMail allows a ReplyTo address ReplyTo if the GMail account has not activated authorization for this account. I am not 100% sure, but I know through the web interface that this is not possible.
Off topic
I would avoid using eregi_replace , it depreciated. Instead, I would use preg_replace . Here is the updated version so you can update your code:
$body = file_get_contents('phpmailer/contents.html'); $body = preg_replace("~[\]~",'',$body); $body = preg_replace("~<name>~i", $name,$body); $body = preg_replace("~<telephone>~i", $telephone, $body); $body = preg_replace("~<email>~i", $email, $body); $body = preg_replace("~<message>~i", $message, $body);
Brad f jacobs
source share