philosophaie — 2012-03-11T20:59:45-04:00 — #1
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.
ralphm — 2012-03-11T22:13:04-04:00 — #2
What problems are you having?
philosophaie — 2012-03-11T22:23:02-04:00 — #3
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>?
ralphm — 2012-03-11T22:35:41-04:00 — #4
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.
philosophaie — 2012-03-11T22:54:46-04:00 — #5
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?