csrb/api/application/helpers/mail_helper.php
2019-10-12 12:04:40 +05:30

51 lines
1.2 KiB
PHP

<?php
class myMail
{
public static function sendmyMail($from,$fromDisplayName,$toWhom,$cc,$bcc,$subject,$mailContent)
{
$CI =&get_instance();
$CI->load->library('myMaillib');
$myMail = $CI->myMaillib->load();
$myMail->IsSMTP(); // Telling the class to use SMTP
$myMail->SMTPAuth = true;
$myMail->SMTPDebug = 0;
$myMail->SMTPSecure = "ssl";
$myMail->Host = 'bh-in-16.webhostbox.net'; // SMTP server
$myMail->Username = "noreply@ssa.sineedge.com"; // "The account"
$myMail->Password = "noreply@ssa"; // "The password"
$myMail->Port = 465; // "The port"
$myMail->addAddress($toWhom); // Name is optional
$myMail->From = $from;
$myMail->FromName = $fromDisplayName;
$myMail->isHTML($isHTM); // Set emyMail format to HTML
$myMail->Subject = $subject;
$myMail->Body = $mailContent;
$myMail->AltBody = $mailContent;
$logger = MYLOG::logFunction();
if(!$myMail->send()) {
log_message("ERROR",($myMail->ErrorInfo));
} else {
log_message("ERROR",("myMailer Send:".$toWhom));
//$logger->info("myMailer Send:" ,array('myMail_ID' => $toWhom,'Status' => 'SEND'));
}
}
}
?>