0

Possible Duplicate:
How to change envelope from address using PHP mail?

My PHP code:

function send ( $from, $to, $subject, $message ) {

    $header = array ();
    $header [] = "MIME-Version: 1.0";
    $header [] = "Content-type: text/html; charset=UTF-8";
    $header [] = "From: =?UTF-8?B?" . base64_encode ( $from [ 'name' ] ) . "?= <" . $from [ 'mail' ] . ">";
    return mail ( $to, "=?UTF-8?B?" . base64_encode ( $subject ) . "?=", $message, implode ( "\r\n", $header ) );

}

send ( array ( 'name' => 'oóöőuúüűÁÉÍ', 'mail' => 'from@mail.mail' ), 'to@mail.mail', 'oóöőuúüűÁÉÍ', 'oóöőuúüűÁÉÍ.' );

It's works, but... The from is not "oóöőuúüűÁÉÍ ", it's "from@mail.mail". The letter source is OK, coded from name and from mail. The view in mail.com account is fail, but the letter source is OK.

Community
  • 1
  • 1
sosdaniel
  • 35
  • 1
  • 6
  • Could you paste in your question the headers of the received e-mail message? That way, we can check if the From header is ok. – pagliuca Oct 29 '12 at 14:34
  • Source: From: =?UTF-8?B?b8Ozw7bFkXXDusO8xbHDgcOJw40=?= <********> – sosdaniel Oct 29 '12 at 15:05
  • Other mail service is view source, that's OK. The mail.com is only fail. – sosdaniel Oct 29 '12 at 15:06
  • So, the email itself works fine in general, just one specific service fails to handle it correctly? In that case I'd start troubleshooting by comparing everything to known good UTF-8 emails sent to the same service via other means. Figure out what they do differently and what you might be missing. – deceze Oct 29 '12 at 15:13

1 Answers1

-1

Try:

$headers []= 'Content-type: text/html; charset=iso-8859-1';

I hope to help!

Daniel S
  • 19
  • 3