Skip to content

Instantly share code, notes, and snippets.

@webestet
Created March 10, 2016 07:24
Show Gist options
  • Save webestet/f944d530090bc11ae424 to your computer and use it in GitHub Desktop.
Save webestet/f944d530090bc11ae424 to your computer and use it in GitHub Desktop.
mail provision
Создать файл test.php c кодом (затем перейти для проверки по адресу www.your-domen.ru/test.php):
<?php
function mail_utf8($to, $subject = '(No subject)', $message = '', $from) {
$header = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain; charset=UTF-8'
. "\n" . 'From: Yourname <' . $from . ">\n";
return mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header);
}
if(mail_utf8('stay_strong@mail.ru','123','123','stay_strong@mail.ru')) {
echo 'ok';
} else {
echo 'false';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment