Advertisement
cahyadyazin

PHPMAILER LIB

Oct 28th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2.   require_once(APPPATH.'libraries/PHPMailerAutoload.php');
  3.   class Mailer{
  4.  
  5.     function send_mailnya($from_email, $from_name, $to_email, $to_name, $subject_email, $message_email){
  6.       $mail = new PHPMailer;
  7.       $mail->isSMTP();
  8.       $mail->Host = $this->config->item('cmail_host');
  9.       $mail->SMTPAuth = $this->config->item('cmail_auth');
  10.       $mail->Username = $this->config->item('cmail_username');
  11.       $mail->Password = $this->config->item('cmail_password');
  12.       $mail->Port = $this->config->item('cmail_port');
  13.  
  14.       $mail->setFrom($from_email, $from_name);
  15.       $mail->addAddress($to_email, $to_name);
  16.       $mail->addReplyTo($from_email, $from_name);
  17.  
  18.       $mail->isHTML(true);
  19.  
  20.       $mail->Subject = $subject_email;
  21.       $mail->Body    = $message_email;
  22.  
  23.     }
  24.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement