Re: [PHP] mail body not decoded by base64_decode

2009-06-02 Thread Manuel Lemos
Hello,

on 05/29/2009 12:15 AM vuthecuong said the following:
 Hi all
 I'm using below function to send Japanese mail, mail clients such as outlook
 etc displayed Japanese text withou problems but if I viewed JP mail via
 web-based mail such as Gmail, the JP subject is normally displayed, however
 the JP body still base64 encoded strings, it still was not decoded yet.
 Could anyone tell me solution to solve this?

That is because you said it is quoted-printable.

Anyway, the encoding of the headers and the body is independent.

You may want to try this MIME message composing and sending class that
can handle all those details. Take a look at the
test_multibyte_message.php script.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mail body not decoded by base64_decode

2009-05-28 Thread vuthecuong

Hi all
I'm using below function to send Japanese mail, mail clients such as outlook
etc displayed Japanese text withou problems but if I viewed JP mail via
web-based mail such as Gmail, the JP subject is normally displayed, however
the JP body still base64 encoded strings, it still was not decoded yet.
Could anyone tell me solution to solve this?
===
private static function _sendPc( $from, $to, $subject, $body, $contentType,
$charSet=shift_jis, $header=, $parameter=){
Debugger::snap();
//make header
$headers = From: $from\n;
$headers .= MIME-Version: 1.0\n;
$headers .= Content-type: $contentType; charset=ISO-2022-JP\n;
//$headers .= Content-type: $contentType; charset=SHIFT_JIS\n;
//$headers .= Content-Transfer-Encoding: base64;
$headers .= Content-Transfer-Encoding: quoted-printable;


// add header to mail
if( strlen( $header )  0 ){
$headers .= \n;
$headers .= $header;
}

//make parameter
$parameters = $parameter;

//make subject
$subject = '=?ISO-2022-JP?B?'.base64_encode(mb_convert_encoding($subject,
'ISO-2022-JP', 'AUTO' )).'?=';
//$subject = '=?SHIFT_JIS?B?'.base64_encode($subject).'?=';
//$body = base64_encode($body);
$body = mb_convert_encoding( $body, 'ISO-2022-JP', AUTO);

// a,b...@mail.com こんなEMAILアドレスがたまにあるための回避策
$pos1 = strpos($to, ,);
$pos2 = strpos($to,);
if( $pos1 !== FALSE  $pos2 === FALSE ){
$to =  . $to .;
}

if( $parameters != null  strlen( $parameters )  0 )
mail( $to, $subject, $body, $headers, $parameters );
else
mail( $to, $subject, $body, $headers,-f . $from );

Debugger::debug( sended );
return true;
}

Thanks and regards,
-- 
View this message in context: 
http://www.nabble.com/mail-body-not-decoded-by-base64_decode-tp23773646p23773646.html
Sent from the PHP - General mailing list archive at Nabble.com.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php