In PHP email only English chars seem well - Greek chars or other shown not understandable
also name of attachment follows the same not valid chars if in Greek or other…
how fix this?
ob_start();
include('applyprocessorConfirm4.php');
$message2 = ob_get_clean();
$headers = "From:info@fff.org";
$headers .= "\\r\
Bcc:info_1@fff.org";
$headers .= "\\r\
Reply-To:{$email}";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "\\r\
MIME-Version: 1.0\
" .
"Content-Type: multipart/mixed;\
" .
" boundary=\\"{$mime_boundary}\\"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\
\
" .
"--{$mime_boundary}\
" .
"Content-Type: text/html; charset=\\"iso-8859-1\\"\
" .
"Content-Transfer-Encoding: 7bit\
\
" .
$message2 . "\
\
";
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
// Add file attachment to the message
$message .= "--{$mime_boundary}\
" .
"Content-Type: {$fileatt_type};\
" .
" name=\\"{$fileatt_name}\\"\
" .
//"Content-Disposition: attachment;\
" .
//" filename=\\"{$fileatt_name}\\"\
" .
"Content-Transfer-Encoding: base64\
\
" .
$data . "\
\
" .
"--{$mime_boundary}--\
";
} else {
$headers .= "\\r\
Content-Type: text/html; charset=UTF-8";
$headers .= "\\r\
MIME-Version: 1.0";
$message = $message2;
}
if ($msgErr=='')
mail($to,$subject,$message,$headers);