本文整理汇总了PHP中SugarPHPMailer::SMTPClose方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarPHPMailer::SMTPClose方法的具体用法?PHP SugarPHPMailer::SMTPClose怎么用?PHP SugarPHPMailer::SMTPClose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarPHPMailer
的用法示例。
在下文中一共展示了SugarPHPMailer::SMTPClose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: in
/* Query database to get case aging */
$query = 'select c.case_number,c.name,concat("http://dcmaster.mydatacom.com/index.php?module=Cases&action=DetailView&record=",c.id) as link from cases as c where c.id not in (select distinct case_id from projects_cases) and c.account_id is null and c.status="New" and c.deleted=0;';
$db = DBManagerFactory::getInstance();
$result = $db->query($query, true, 'Case Unassigned Query Failed');
/* Create email bodies to send */
$linecount = 0;
$emailbody = "The following cases are currently unassigned:<br /><br />";
while (($row = $db->fetchByAssoc($result)) != null) {
$emailbody .= "<a href='" . $row['link'] . "'>" . $row['case_number'] . " - " . $row['name'] . " </a><br />";
$linecount++;
}
if ($linecount > 0) {
/* Send out emails */
$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->setMailerForSystem();
$mail->From = $defaults['email'];
$mail->FromName = $defaults['name'];
$mail->ClearAllRecipients();
$mail->ClearReplyTos();
$mail->Subject = "Unassigned Case Report";
$mail->IsHTML(true);
$mail->Body = $emailbody;
$mail->AltBody = $emailbody;
$mail->prepForOutbound();
$mail->AddAddress('noc@getdatacom.com');
$mail->Send();
/* Clean up shop */
$mail->SMTPClose();
}