Last active
May 1, 2019 10:45
-
-
Save BAHC/a834515aeed30fc322a3e5499b135bb1 to your computer and use it in GitHub Desktop.
Mailer for Yesbol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 = '<[email protected]>'; | |
$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