Download the distribution. Rename folder, phpmailerv2.3 to phpmailer. Save in Application/plugins directory. Create file and name to phpmailer_pi.php
phpmailer_pi.php
function send_email($recipient, $sender, $subject, $message) { require_once("phpmailer/class.phpmailer.php");
$mail = new PHPMailer(); $body = $message; $mail->IsSMTP(); $mail->FromName = "Bargain Philippines"; $mail->From = $sender; $mail->Subject = $subject; $mail->AltBody = strip_tags($message); $mail->MsgHTML($body); $mail->AddAddress($recipient); if ( ! $mail->Send()) { echo 'Failed to Send'; } else { echo 'Mail Sent'; }
} ?>
From the controller:
load->plugin('phpmailer'); send_mail('sample@sample.com', 'you@you.com', 'subject', 'message body'); }
?>
There was an error while loading. Please reload this page.