本文整理匯總了PHP中Emails::getProvinceEmails方法的典型用法代碼示例。如果您正苦於以下問題:PHP Emails::getProvinceEmails方法的具體用法?PHP Emails::getProvinceEmails怎麽用?PHP Emails::getProvinceEmails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Emails
的用法示例。
在下文中一共展示了Emails::getProvinceEmails方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: email_sender
function email_sender($report_name, $start_date, $end_date, $district_or_region, $vals, $store)
{
//setting the connection variables
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = stripslashes('D.V.I.VaccinesKenya@gmail.com');
$config['smtp_pass'] = stripslashes('projectDVI');
ini_set("SMTP", "ssl://smtp.gmail.com");
ini_set("smtp_port", "465");
ini_set("max_execution_time", "50000");
if ($vals == 1) {
$emails = Emails::getProvinceEmails($district_or_region);
} else {
if ($vals == 2) {
$emails = Emails::getDistrictEmails($district_or_region);
} else {
if ($vals == 3) {
$emails = Emails::getEmails();
}
}
}
//pulling emails from the DB
$this->load->library('email', $config);
$path = $_SERVER["DOCUMENT_ROOT"];
$file = $path . "/DVI/application/pdf/" . $report_name;
//puts the path where the pdf's are stored
foreach ($emails as $email) {
$this->email->attach($file);
$address = $email['email'];
$this->email->set_newline("\r\n");
$start_text_date = date("M j, Y", strtotime($start_date));
$end_text_date = date("M j, Y", strtotime($end_date));
$this->email->from('D.V.I.VaccinesKenya@gmail.com', "DVI MAILER");
//user variable displays current user logged in from sessions
$this->email->to("{$address}");
$this->email->subject("{$store}" . ' MONTHLY REPORT.');
$this->email->message('Please find the Report Attached for ' . "{$store}" . ' Period of ' . "{$start_text_date}" . ' to ' . "{$end_text_date}");
//success message else show the error
if ($this->email->send()) {
echo 'Your email was sent, successfully to ' . $address . '<br/>';
//unlink($file);
$this->email->clear(TRUE);
} else {
show_error($this->email->print_debugger());
}
}
ob_end_flush();
unlink($file);
//delete the attachment after sending to avoid clog up of pdf's
}