adding proper headers for HTML mail

This commit is contained in:
Sebastian Grewe 2013-05-25 12:25:41 +02:00
parent 787942b6f9
commit 93d0ec06a6
2 changed files with 17 additions and 14 deletions

View File

@ -368,7 +368,13 @@ class User {
$smarty->assign('TOKEN', $token);
$smarty->assign('USERNAME', $username);
$smarty->assign('WEBSITENAME', $this->config['website']['name']);
if (mail($email, $smarty->fetch('templates/mail/subject.tpl'), $smarty->fetch('templates/mail/body.tpl'))) {
$headers = 'From: Website Administration <' . $this->config['website']['email'] . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (mail($email,
$smarty->fetch('templates/mail/subject.tpl'),
$smarty->fetch('templates/mail/body.tpl'),
$headers)) {
return true;
} else {
$this->setErrorMessage("Unable to send mail to your address");

View File

@ -1,13 +1,10 @@
Hello {$USERNAME},
You have requested a password reset through our online form.
In order to complete the request please follow this link
http://{$smarty.server.SERVER_NAME}{$smarty.server.PHP_SELF}?page=password&action=change&token={$TOKEN}
You will be asked to change your password. You can then use this new
password to login to your account.
Cheers,
Website Administration
<html>
<body>
<p>Hello {$USERNAME},</p><br />
<p>You have requested a password reset through our online form. In order to complete the request please follow this link:</p>
<p>http://{$smarty.server.SERVER_NAME}{$smarty.server.PHP_SELF}?page=password&action=change&token={$TOKEN}</p>
<p>You will be asked to change your password. You can then use this new password to login to your account.</p>
<p>Cheers,</p>
<p>Website Administration</p>
</body>
</html>