I'm trying to figure out why when my code sends the email with special characters ( such as ç é í ó...) They don't get sent that way. Those character get sent differently ( like this é fã)
Any help is appreciated.
Code: Select all
//notification about new message
$followers = $_SESSION['user']->get_followers();
if(is_array($followers)) foreach($followers as $f){
if($f->notify_direct == 0 && !$f->has_friend_nf($_SESSION['user']->id)){
if($f->notify_way == 'email'){
$msg = notification_mail;
$msg = str_replace("#recipient_name", $f->username, notification_mail);
$msg = str_replace("#author_name", $_SESSION['user']->username, $msg);
$msg = str_replace("#author_link", $base_href.$_SESSION['user']->username, $msg);
$msg = str_replace("#message", urldecode($_POST['message']), $msg);
$to = $f->email;
$subject = str_replace("#username", $_SESSION['user']->username, notification_subject);
$headers = "From: Admin<".CONTACT_MAIL.">";
mail($to, $subject, $msg, $headers);
} else if($f->notify_way == 'sms'){
if($f->phone && $f->sms_credits > 0){
$to = $f->phone;
$msg = notification_sms;
$msg = str_replace("#recipient_name", $f->username, $msg);
$msg = str_replace("#author_name", $_SESSION['user']->username, $msg);
$msg = str_replace("#message", urldecode($_POST['message']), $msg);
send_sms($to, $msg);
}
} else if($f->notify_way == 'im' && !$f->has_friend_nf($_SESSION['user']->id)){
$db->db_insert("nudges", "user, txt", "{$f->id}, '{$_SESSION['user']->username}:\n{$_POST['message']}'");