Send email notifications with proper charset encoding

Everything related to GBook PHP guestbook
Post Reply
tonecas
Posts: 2
Joined: Sat Sep 27, 2008 9:25 pm

Send email notifications with proper charset encoding

Post by tonecas »

/*************************************
Title: GBook
Version: 1.6
Author: Antonio Vaz
Short description: Send notification emails with correct encoding


*************************************/

Hi,

if you want to receive emails notifying you of new posts but you are using language/encondings that are non english/non ascii based, then set your encoding to UTF-8 on your language file :

$lang['enc']='utf-8';


and change this in gbook.php:

mail("$settings[admin_email]",$lang['t41'],$message);

to

$headers = 'Content-type: text/plain; charset='.$lang['enc']."\r\n";
mail("$settings[admin_email]",$lang['t41'],$message, $headers);

regards,
tonecas
Post Reply