Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Open core/engine.php and replace function end_email by this one: */
- public function send_email($to_user, $subject, $message) {
- if(SITE_EMAIL_NOTIFICATIONS==1) {
- if(filter_var($to_user, FILTER_VALIDATE_EMAIL)) {
- $to = $to_user;
- }
- else {
- $to = engine::getuserdata($to_user,"EMAIL");
- }
- if(SMTP_USER!='' && SMTP_PASS!='') {
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPDebug = 1;
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = 'ssl';
- $mail->Host = SITE_SMTP_HOST;
- $mail->Port = SITE_SMTP_PORT;
- $mail->IsHTML(true);
- $mail->Username = SITE_SMTP_USER;
- $mail->Password = SITE_SMTP_PASS;
- $mail->SetFrom(SITE_SMTP_USER, SITE_NAME);
- $mail->AddReplyTo(SITE_SMTP_USER, "No-Reply");
- $mail->Subject = $subject;
- $mail->Body = $message;
- $mail->AddAddress($to);
- $mail->Send();
- }
- else {
- $headers = 'From: '.SITE_NAME.' no-reply@'.SITE_DOMAIN.'' . "\r\n" ;
- $headers .='Reply-To: '. $to . "\r\n" ;
- $headers .='X-Mailer: PHP/' . phpversion();
- $headers .= "MIME-Version: 1.0\r\n";
- $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
- mail($to, $subject, $message, $headers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement