...

View Full Version : email error



docock
12-08-2010, 02:11 PM
I'm using the coding below to send an activation email whenever someone signs up at my page.

However I'm getting this error: Parse error: syntax error, unexpected T_VARIABLE in /home/a1332560/public_html/index.php on line 16

which refers to the line with the url in it.
What's wrong with that line? And how can I add some html coding with pictures to this email?



echo "Your activation mail has been sent!";
$to = $_POST[email];
$subject = "mysite.com activation mail";
$from = "From: sender@example.com\r\n"
$body = "Thanks for registering at mysite.com.\n <br>Click <a href='http://mysite.com/activate.php'> here </a> to complete the registration.";
if (mail($to, $subject, $body, $from)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}

poyzn
12-08-2010, 02:16 PM
you've missed ";" after "$from" string
you can si,ply include any html-rich content but then should add content-header "Content-Type: text/html; charset=your encoding here"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum