diff --git a/include/items.php b/include/items.php index 82752e168..733cd8048 100644 --- a/include/items.php +++ b/include/items.php @@ -1415,7 +1415,9 @@ function new_follower($importer,$contact,$datarray,$item) { $res = mail($r[0]['email'], t("You have a new follower at ") . $a->config['sitename'], $email, - 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] ); + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); } } diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 02437ec36..58473146d 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -651,7 +651,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) { ); $res = mail($r[0]['email'], sprintf( t("Connection accepted at %s") , $a->config['sitename']), - $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] ); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + if(!$res) { // pointless throwing an error here and confusing the person at the other end of the wire. } diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index f6f68d348..eb9d71fe3 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -401,7 +401,11 @@ function dfrn_notify_post(&$a) { )); $res = mail($importer['email'], sprintf(t('%s commented on an item at %s'), $from , $a->config['sitename']), - $email_tpl, "From: " . t('Administrator') . '@' . $a->get_hostname() ); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + } } xml_status(0); @@ -487,7 +491,11 @@ function dfrn_notify_post(&$a) { )); $res = mail($importer['email'], sprintf( t("%s commented on an item at %s") , $from ,$a->config['sitename']), - $email_tpl, "From: ".t("Administrator") . "@". $a->get_hostname() ); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + break; } } diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 11b7438a7..3c1c216fe 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -544,7 +544,10 @@ function dfrn_request_content(&$a) { $res = mail($r[0]['email'], t("Introduction received at ") . $a->config['sitename'], $email, - 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] ); + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + // This is a redundant notification - no point throwing errors if it fails. } if($auto_confirm) { diff --git a/mod/invite.php b/mod/invite.php index 84fa978ad..1c5119595 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -30,7 +30,11 @@ function invite_post(&$a) { } $res = mail($recip, sprintf(t('Please join my network on %s'), $a->config['sitename']), - $message, "From: " . $a->user['email']); + $message, + "From: " . $a->user['email'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + if($res) { $total ++; } diff --git a/mod/item.php b/mod/item.php index 5cefb3be3..26afec2f4 100644 --- a/mod/item.php +++ b/mod/item.php @@ -472,7 +472,10 @@ function item_post(&$a) { )); $res = mail($user['email'], sprintf( t("%s commented on your item at %s") ,$from,$a->config['sitename']), - $email_tpl,"From: " . t("Administrator") . "@" . $a->get_hostname() ); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); } } else { @@ -495,7 +498,11 @@ function item_post(&$a) { )); $res = mail($user['email'], sprintf( t("%s posted on your profile wall at %s") ,$from, $a->config['sitename']), - $email_tpl,"From: " . t("Administrator") . "@" . $a->get_hostname() ); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + } } diff --git a/mod/lostpass.php b/mod/lostpass.php index c46a57e6a..8d1cf7629 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -36,7 +36,11 @@ function lostpass_post(&$a) { )); $res = mail($email, sprintf( t('Password reset requested at %s'),$a->config['sitename']), - $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME]); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + goaway($a->get_baseurl()); } @@ -94,7 +98,10 @@ function lostpass_content(&$a) { '$new_password' => $new_password, '$uid' => $newuid )); - $res = mail($email,"Your password has changed at {$a->config['sitename']}",$email_tpl,"From: Administrator@{$_SERVER[SERVER_NAME]}"); + $res = mail($email,"Your password has changed at {$a->config['sitename']}",$email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); return $o; } diff --git a/mod/register.php b/mod/register.php index 5fe7c0c6d..83e9e2891 100644 --- a/mod/register.php +++ b/mod/register.php @@ -329,7 +329,10 @@ function register_post(&$a) { '$uid' => $newuid )); $res = mail($email, sprintf(t('Registration details for %s'), $a->config['sitename']), - $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME']); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); if($res) { @@ -366,8 +369,10 @@ function register_post(&$a) { )); $res = mail($a->config['admin_email'], sprintf(t('Registration request at %s'), $a->config['sitename']), - $email_tpl,'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME']); - + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); if($res) { notice( t('Your registration is pending approval by the site owner.') . EOL ) ; goaway($a->get_baseurl()); diff --git a/mod/regmod.php b/mod/regmod.php index 2cbe810bc..b985ee364 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -90,7 +90,10 @@ function regmod_content(&$a) { )); $res = mail($user[0]['email'], sprintf(t('Registration details for %s'), $a->config['sitename']), - $email_tpl,'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] ); + $email_tpl, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); if($res) { notice( t('Account approved.') . EOL );