note 69932 added to function.mail
| From: | i5513 at osu1 dot php dot net | Date: | Wed, 27 Sep 2006 08:30:20 +0000 |
| Subject: | note 69932 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117708@lists.php.net to get a copy of this message | ||
I had a trouble with marcelo' function, I had to add "$val == 63" condition into
"if" sentence for '?' character
# From marcelo post:
function encode_iso88591($string)
{
$text = '=?iso-8859-1?q?';
for( $i = 0 ; $i < strlen($string) ; $i++ )
{
$val = ord($string[$i]);
if($val > 127 or $val == 63)
{
$val = dechex($val);
$text .= '='.$val;
}
else
{
$text .= $string[$i];
}
}
$text .= '?=';
return $text;
}
and later use:
// create email
$msg = wordwrap($msg, 70);
$to = "destination@company.com";
$subject = encode_iso88591("hoydÃa caminé !!");
$headers = "MIME-Versin: 1.0\r\n" .
"Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n" .
"Content-Transfer-Encoding: 8bit\r\n" .
"From: $from\r\n" .
"X-Mailer: PHP" . phpversion();
mail($to, $subject, $msg, $headers);
----
Server IP: 66.163.161.117
Probable Submitter: 89.140.6.2
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/69932
Del: integrated -- https://master.php.net/note/delete/69932/integrated
Del: useless -- https://master.php.net/note/delete/69932/useless
Del: bad code -- https://master.php.net/note/delete/69932/bad+code
Del: spam -- https://master.php.net/note/delete/69932/spam
Del: non-english -- https://master.php.net/note/delete/69932/non-english
Del: in docs -- https://master.php.net/note/delete/69932/in+docs
Del: other reasons-- https://master.php.net/note/delete/69932
Reject -- https://master.php.net/note/reject/69932
Search -- https://master.php.net/manage/user-notes.php