Skip to content

Instantly share code, notes, and snippets.

@BAHC
Last active May 1, 2019 10:45
Show Gist options
  • Save BAHC/a834515aeed30fc322a3e5499b135bb1 to your computer and use it in GitHub Desktop.
Save BAHC/a834515aeed30fc322a3e5499b135bb1 to your computer and use it in GitHub Desktop.
Mailer for Yesbol
<?php
//....
$pass = 'qwertyqwerty';
//$row['user_mail'] = 'wans@localhost';
//$row['id_user'] = 1;
$link = 'http://elink.kz/respass/reset/code/'.md5($pass).'/'.$row['id_user'];
$from = '<register@elink.kz>';
$to = '<'. $row['user_mail'] .'>';
$subject = base64_encode('Изменить пароль');
$message ='текст текст: '.$link;
// To send HTML mail, the Content-type header must be set
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset="UTF-8"';
// Additional headers
$headers[] = 'To: '. $to;
$headers[] = 'From: '. $from;
$headers[] = 'Reply-To: '. $from;
$headers[] = 'X-Mailer: ElinkMailer';
// Mail it
$success = mail($to, $subject, $message, implode("\r\n", $headers));
if (!$success) {
$errorMessage = error_get_last()['message'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment