当前位置: 首页>>代码示例>>PHP>>正文


PHP SMTP::sendmail方法代码示例

本文整理汇总了PHP中SMTP::sendmail方法的典型用法代码示例。如果您正苦于以下问题:PHP SMTP::sendmail方法的具体用法?PHP SMTP::sendmail怎么用?PHP SMTP::sendmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SMTP的用法示例。


在下文中一共展示了SMTP::sendmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: strtotime

 $ticket_created_time = strtotime($ticket_created);
 $time = ($now_time - $ticket_created_time) / 3600;
 if ($time > 24) {
     $ticket_summary = selectWhere("summary", "ticket", "id", $ticket_id);
     $ticket_reporter = selectWhere("reporter", "ticket", "id", $ticket_id);
     $ticket_reporter_mail = selectWhere("email", "user", "user_name", $ticket_reporter);
     $ticket_owner = selectWhere("owner", "ticket", "id", $ticket_id);
     $owner = selectWhere("chinese_name", "user", "user_name", $ticket_owner);
     $ticket_owner_mail = selectWhere("email", "user", "user_name", $ticket_owner);
     $url = "http://ibug.corp.anjuke.com/ticket/detail?ticket_id=" . $ticket_id;
     $mail_body = "<b>BUG:</b><font color='red'><a href='" . $url . "'>" . $ticket_id . "</a>已超过24小时,仍未解决,请抓紧修复!</font></br><b>owner:</b>" . $owner . "</br><b>BUG存在时间:</b>" . round($time) . "小时</br><b>BUG标题:</b>" . $ticket_summary;
     if ($ticket_owner == "Tonyzhao" || $ticket_owner == "jieliu" || $ticket_owner == "ericwang" || $ticket_owner == "eddietian" || $ticket_owner == "kyouzhang" || $ticket_owner == "zhangjianliu") {
         $ticket_leader_mail = "zhangjianliu@anjuke.com,haocheng@anjuke.com";
         $mail_to = $ticket_reporter . ',' . $ticket_owner_mail;
         $cc_to = $ticket_leader_mail;
         $smtp->sendmail($mail_to, $smtp_usermail, $mail_subject, $mail_body, $mail_type, $cc_to);
     } else {
         if ($ticket_owner == "Lizzyyang" || $ticket_owner == "jieliu" || $ticket_owner == "yangcui" || $ticket_owner == "zhangtao" || $ticket_owner == "zhiwensun" || $ticket_owner == "hanjunfeng") {
             $ticket_leader_mail = "hanjunfeng@anjuke.com,haocheng@anjuke.com";
             $mail_to = $ticket_reporter . ',' . $ticket_owner_mail;
             $cc_to = $ticket_leader_mail;
             $smtp->sendmail($mail_to, $smtp_usermail, $mail_subject, $mail_body, $mail_type, $cc_to);
         } else {
             if ($ticket_owner == "kakiezhang" || $ticket_owner == "shuaiyan" || $ticket_owner == "bossni" || $ticket_owner == "jackyang") {
                 $ticket_leader_mail = "jackyang@anjuke.com,haocheng@anjuke.com";
                 $mail_to = $ticket_reporter . ',' . $ticket_owner_mail;
                 //          $mail_to="jianqiangni@anjuke.com";
                 $cc_to = $ticket_leader_mail;
                 $smtp->sendmail($mail_to, $smtp_usermail, $mail_subject, $mail_body, $mail_type, $cc_to);
             } else {
                 if ($ticket_owner == "dinglin" || $ticket_owner == "rayliu") {
开发者ID:emilymwang8,项目名称:ibug,代码行数:31,代码来源:OverTime.php

示例2: date

$count = array_merge($count_current, $count_before);
$smtp_server = APF::get_instance()->get_config('smtp_server');
$smtp_port = APF::get_instance()->get_config('smtp_port');
$smtp_user = APF::get_instance()->get_config('smtp_user');
$smtp_pass = APF::get_instance()->get_config('smtp_pass');
$smtp_usermail = APF::get_instance()->get_config('smtp_usermail');
$smtp_emailto = 'dl-tech-qa@anjuke.com';
$cc_to = 'dl-tech-haozu@anjuke.com,dl-tech-pd-aifang@anjuke.com,dl-tech-pdsec@anjuke.com,dl-tech-jpse@anjuke.com,ibug@anjuke.com';
$mail_subject = '[iBug]Daily Reporter' . ' - ' . $date;
$template = new Template();
$mail_body = $template->load_daily_reporter_html_template($count);
$mail_type = 'HTML';
$smtp = new SMTP($smtp_server, $smtp_port, true, $smtp_user, $smtp_pass);
$smtp->debug = true;
$smtp->set_from("IBug No-Reply", $smtp_usermail);
$flag = $smtp->sendmail($smtp_emailto, $smtp_usermail, $mail_subject, $mail_body, $mail_type, $cc_to);
echo date('c ') . "SMTP_SERVER: {$smtp_server} \n";
echo date('c ') . "SUBJECT: {$mail_subject} \n";
echo date('c ') . "FROM: {$smtp_usermail} \n";
echo date('c ') . "TO: {$smtp_emailto} \n";
echo date('c ') . "CC: {$cc_to} \n";
if ($flag) {
    echo date('c ') . "Send Reporter Successfully!\n";
} else {
    $filename = APF::get_instance()->get_config('mail_error_log');
    $content = "Sent Daily Reporter - " . $date . " error\n";
    if (is_writable($filename)) {
        if (!($handle = fopen($filename, 'a'))) {
            echo date('c ') . "Cannot open file " . $filename . "\n";
            exit;
        }
开发者ID:emilymwang8,项目名称:ibug,代码行数:31,代码来源:SendDailyReporter.php

示例3: notify

 private function notify()
 {
     $smtpserver = $this->smtp['smtpserver'];
     $smtpserverport = $this->smtp['smtpserverport'];
     $smtpuser = $this->smtp['smtpuser'];
     $smtppass = $this->smtp['smtppass'];
     $smtp_usermail = $this->smtp['smtp_usermail'];
     $smtp = new SMTP($smtpserver, $smtpserverport, false, $smtpuser, $smtppass);
     $smtp->set_from("SearchCloud", "solr@sc10-001.a.ajkdns.com");
     $smtp->debug = false;
     $cc = '';
     $bcc = '';
     foreach ($this->alert as $name => $msg) {
         if (empty($msg)) {
             continue;
         }
         $userinfo = $this->get_user_info($name);
         print_r($userinfo);
         if (!empty($userinfo['email'])) {
             /*发Email*/
             $sent = $smtp->sendmail($userinfo['email'], $smtp_usermail, 'SearchCloud报警邮件', $msg, 'HTML', $cc, $bcc);
             print_r($sent);
         }
         if (!empty($userinfo['mobile'])) {
             /*发SMS*/
             $sent = $smtp->sendmail($userinfo['mobile'] . '@139.com', $smtp_usermail, 'SearchCloud报警邮件', $msg, 'HTML', $cc, $bcc);
             print_r($sent);
         }
     }
 }
开发者ID:referjs,项目名称:solrcloud,代码行数:30,代码来源:alert.php


注:本文中的SMTP::sendmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。