I am trying to mail using mail. Mail is configured correctly and does work. I am having problems with the message in php mail:
$message = "<p>Welcome to the site!</p><p>These additions were made:</p><p>addition1=$addition1</p><p>addition2=$addition2</p>";
mail('$email', 'Changes', '$message');
Lets see what you can do with this.
What problems are you having?
I have tried with double quotes, single quotes and no quotes. I triple checked the surronding code for errors but I am getting this error on the $message line.
Parse error: syntax error, unexpected T_STRING in /path/file.php on line 29
Is there something wrong with my syntax with <p></p>?
I don't know enough about this to be a real help, but if you want to output HTML in the message body, you have to specify that. So try adding a fourth $headers part to the mail() function and include something like this:
$header = "Content-Type: text/html; charset=UTF-8;\\r\
mail($email, 'Changes', $message, $header);
Also, try removing those quotes around the variables in the mail() function.
Added header and took out the quotes. Here is the real massage:
$message = "<p>Welcome to Philosophaie's Astronomy Site!</p><p>Thank you, $username for Registering.</p><p>To complete your membership click the link below.</p><p><a href = "http://www.philosophaie.heliohost.org/afterregister.php/id=$id">Complete Registration - Click Here</a></p>";
Where am I going wrong?
This topic is now closed. New replies are no longer allowed.