Example #1
0
 function send($mail)
 {
     $saemail = new SaeMail();
     $saemail->setOpt(array('from' => '贴吧签到助手 <' . $this->_get_setting('address') . '>', 'to' => $mail->address, 'smtp_host' => $this->_get_setting('smtp_server'), 'smtp_username' => $this->_get_setting('smtp_name'), 'smtp_password' => $this->_get_setting('smtp_pass'), 'subject' => $mail->subject, 'content' => $mail->message, 'content_type' => 'HTML'));
     $saemail->send();
     return true;
 }
 /**
  * 快捷发送一封邮件
  * @param string $to 收件人
  * @param string $sub 邮件主题
  * @param string $msg 邮件内容(HTML)
  * @param array $att 附件,每个键为文件名称,值为附件内容(可以为二进制文件),例如array('a.txt' => 'abcd' , 'b.png' => file_get_contents('x.png'))
  * @return bool 成功:true 失败:错误消息
  */
 public static function mail($to, $sub = '无主题', $msg = '无内容', $att = array())
 {
     if (defined("SAE_MYSQL_DB") && class_exists('SaeMail')) {
         $mail = new SaeMail();
         $options = array('from' => option::get('mail_name'), 'to' => $to, 'smtp_host' => option::get('mail_host'), 'smtp_port' => option::get('mail_port'), 'smtp_username' => option::get('mail_smtpname'), 'smtp_password' => option::get('mail_smtppw'), 'subject' => $sub, 'content' => $msg, 'content_type' => 'HTML');
         $mail->setOpt($options);
         $ret = $mail->send();
         if ($ret === false) {
             return 'Mail Send Error: #' . $mail->errno() . ' - ' . $mail->errmsg();
         } else {
             return true;
         }
     } else {
         $From = option::get('mail_name');
         if (option::get('mail_mode') == 'SMTP') {
             $Host = option::get('mail_host');
             $Port = intval(option::get('mail_port'));
             $SMTPAuth = (bool) option::get('mail_auth');
             $Username = option::get('mail_smtpname');
             $Password = option::get('mail_smtppw');
             $Nickname = option::get('mail_yourname');
             if (option::get('mail_ssl') == '1') {
                 $SSL = true;
             } else {
                 $SSL = false;
             }
             $mail = new SMTP($Host, $Port, $SMTPAuth, $Username, $Password, $SSL);
             $mail->att = $att;
             if ($mail->send($to, $From, $sub, $msg, $Nickname)) {
                 return true;
             } else {
                 return $mail->log;
             }
         } else {
             $name = option::get('mail_yourname');
             $mail = new PHPMailer();
             $mail->setFrom($From, $name);
             $mail->addAddress($to);
             $mail->Subject = $sub;
             $mail->msgHTML($msg);
             $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
             foreach ($att as $n => $d) {
                 $mail->addStringAttachment($d, "=?UTF-8?B?" . base64_encode($n) . "?=", 'base64', get_mime(get_extname($n)));
             }
             if (!$mail->send()) {
                 return $mail->ErrorInfo;
             } else {
                 return true;
             }
         }
     }
 }
Example #3
0
 /**
  * 快捷发送一封邮件
  * @param string $to 收件人
  * @param string $sub 邮件主题
  * @param string $msg 邮件内容(HTML)
  * @param array $att 附件,每个键为文件名称,值为附件内容(可以为二进制文件),例如array('a.txt' => 'abcd' , 'b.png' => file_get_contents('x.png'))
  * @return bool 成功:true 失败:错误消息
  */
 public static function mail($to, $sub = '无主题', $msg = '无内容', $att = array())
 {
     if (defined("SAE_MYSQL_DB") && class_exists('SaeMail')) {
         $mail = new SaeMail();
         $options = array('from' => option::get('mail_name'), 'to' => $to, 'smtp_host' => option::get('mail_host'), 'smtp_port' => option::get('mail_port'), 'smtp_username' => option::get('mail_smtpname'), 'smtp_password' => option::get('mail_smtppw'), 'subject' => $sub, 'content' => $msg, 'content_type' => 'HTML');
         $mail->setOpt($options);
         $ret = $mail->send();
         if ($ret === false) {
             return 'Mail Send Error: #' . $mail->errno() . ' - ' . $mail->errmsg();
         } else {
             return true;
         }
     } else {
         $From = option::get('mail_name');
         if (option::get('mail_mode') == 'SMTP') {
             $Host = option::get('mail_host');
             $Port = intval(option::get('mail_port'));
             $SMTPAuth = (bool) option::get('mail_auth');
             $Username = option::get('mail_smtpname');
             $Password = option::get('mail_smtppw');
             $Nickname = option::get('mail_yourname');
             if (option::get('mail_ssl') == '1') {
                 $SSL = true;
             } else {
                 $SSL = false;
             }
             $mail = new SMTP($Host, $Port, $SMTPAuth, $Username, $Password, $SSL);
             $mail->att = $att;
             if ($mail->send($to, $From, $sub, $msg, $Nickname)) {
                 return true;
             } else {
                 return $mail->log;
             }
         } else {
             $header = "MIME-Version:1.0\r\n";
             $header .= 'Content-type: text/html; charset=utf-8' . "\r\n";
             $header .= "To: " . $to . "\r\n";
             $header .= "From: " . $From . "\r\n";
             $header .= "Subject: " . $sub . "\r\n";
             $header .= 'Reply-To: ' . $From . "\r\n";
             $header .= "Date: " . date("r") . "\r\n";
             $header .= "Content-Transfer-Encoding: base64\r\n";
             return mail($to, $sub, base64_encode($msg), $header);
         }
     }
 }
Example #4
0
/**
 * SAE邮件发送函数
 * @param string $to 接收邮件者邮箱
 * @param string $name 接收邮件者名称
 * @param string $subject 邮件主题
 * @param string $body 邮件内容
 * @param string $attachment 附件列表
 * @茉莉清茶 57143976@qq.com
 */
function sae_mail($to = '', $subject = '', $body = '', $name = '')
{
    if ($to == '') {
        $to = C('MAIL_SMTP_CE');
        //邮件地址为空时,默认使用后台默认邮件测试地址
    }
    if ($name == '') {
        $name = C('WEB_SITE');
        //发送者名称为空时,默认使用网站名称
    }
    if ($subject == '') {
        $subject = C('WEB_SITE_TITLE');
        //邮件主题为空时,默认使用网站标题
    }
    if ($body == '') {
        $body = C('WEB_SITE_DESCRIPTION');
        //邮件内容为空时,默认使用网站描述
    }
    $mail = new SaeMail();
    $mail->setOpt(array('from' => C('MAIL_SMTP_USER'), 'to' => $to, 'smtp_host' => C('MAIL_SMTP_HOST'), 'smtp_username' => C('MAIL_SMTP_USER'), 'smtp_password' => C('MAIL_SMTP_PASS'), 'subject' => $subject, 'content' => $body, 'content_type' => 'HTML'));
    $ret = $mail->send();
    return $ret ? true : $mail->errmsg();
    //返回错误信息
}
Example #5
0
function saemail($address, $subject, $message)
{
    global $_config;
    $mail = new SaeMail();
    $mail->setOpt(array('from' => 'Mail-System <' . $_config['mail']['saemail']['address'] . '>', 'to' => $address, 'smtp_host' => $_config['mail']['saemail']['smtp_server'], 'smtp_username' => $_config['mail']['saemail']['smtp_name'], 'smtp_password' => $_config['mail']['saemail']['smtp_pass'], 'subject' => $subject, 'content' => $message, 'content_type' => 'HTML'));
    $mail->send();
    return true;
}
Example #6
0
 function noticemail_html($to, $subject, $mail_content_title, $mail_content_mainstr, $mail_content_buttomstr, $proj = '')
 {
     $mail_config['from'] = '*****@*****.**';
     $mail_config['smtp_host'] = 'smtp.163.com';
     $mail_config['smtp_username'] = '******';
     $mail_config['smtp_password'] = '******';
     $mail_config['to'] = $to;
     $mail_config['subject'] = $subject;
     $mail_config['content_type'] = 'HTML';
     $mail_config['content'] = '<html><body><table><tr><td style="background-color:#DFDFDF;width:486px;"><span style="color:#404040;font-weight:bold;font-size:20px;font-family:微软雅黑;黑体;sans-serif;">&nbsp;' . $mail_content_title . '</span></td>';
     $mail_config['content'] .= '<td><a href="http://rainbowbridge.sinaapp.com/ts/"><img width=240 height=38 style="width:240px; height:38px" src="http://rainbowbridge.sinaapp.com/ts/misc/resources/firstshin.jpg"></img></a></td></tr>';
     $mail_config['content'] .= '<tr><td colspan=2 style="font-size:12px;padding:10px;">' . $mail_content_mainstr . '</td></tr>';
     $mail_config['content'] .= '<tr><td colspan=2 style="font-size:12px;background-color:#DFDFDF;text-align:center;color:#606060;height:48px;">' . $mail_content_buttomstr . '如有任何问题请<a href="mailto:xp@firstshin.com">及时联系</a>。</td></tr></table></body></html>';
     $mail = new SaeMail();
     $mail->setOpt($mail_config);
     $mail->send();
 }
Example #7
0
        $mbody[1] = '今天是' . $json['weatherinfo']['date_y'] . '' . $json['weatherinfo']['week'];
        $mbody[2] = '1天后:' . $json['weatherinfo']['temp1'] . ' ' . $json['weatherinfo']['weather1'] . ' ' . $json['weatherinfo']['wind1'] . $json['weatherinfo']['fl1'];
        $mbody[3] = '2天后:' . $json['weatherinfo']['temp2'] . ' ' . $json['weatherinfo']['weather2'] . ' ' . $json['weatherinfo']['wind2'] . $json['weatherinfo']['fl2'];
        $mbody[4] = '3天后:' . $json['weatherinfo']['temp3'] . ' ' . $json['weatherinfo']['weather3'] . ' ' . $json['weatherinfo']['wind3'] . $json['weatherinfo']['fl3'];
        $mbody[5] = '4天后:' . $json['weatherinfo']['temp4'] . ' ' . $json['weatherinfo']['weather4'] . ' ' . $json['weatherinfo']['wind4'] . $json['weatherinfo']['fl4'];
        $mbody[6] = '5天后:' . $json['weatherinfo']['temp5'] . ' ' . $json['weatherinfo']['weather5'] . ' ' . $json['weatherinfo']['wind5'] . $json['weatherinfo']['fl5'];
        $mbody[7] = '6天后:' . $json['weatherinfo']['temp6'] . ' ' . $json['weatherinfo']['weather6'] . ' ' . $json['weatherinfo']['wind6'] . $json['weatherinfo']['fl6'];
        $mbody[17] = '微博:' . '淡淡清香弥漫世界';
        $mopt['from'] = '用户名密码@gmail.com';
        $mopt['smtp_host'] = 'smtp.gmail.com';
        $mopt['smtp_port'] = 587;
        $mopt['smtp_username'] = '******';
        $mopt['smtp_password'] = '******';
        $mopt['subject'] = $json['weatherinfo']['city'] . '天气预报';
        $mopt['content'] = $mbody[1] . '<br />' . $mbody[2] . '<br />' . $mbody[3] . '<br />' . $mbody[4] . '<br />' . $mbody[5] . '<br />' . $mbody[6] . '<br />' . $mbody[7] . '<br />' . $mbody[17];
        $mopt['content_type'] = 'HTML';
        $mopt['tls'] = true;
        $mopt['to'] = $row['Email'];
        $fh[0] = 0;
        $fh[1] = 0;
        $mail = new SaeMail();
        $mail->setOpt($mopt);
        $mail->send();
        $fh[0] = $fh[0] + 1;
        $fh[1] = $fh[1] + 1;
    } else {
        $fh[1] = $fh[1] + 1;
    }
}
mysql_close($con);
echo '数量:' . $fh[0] . '/' . $fh[1];
Example #8
0
 /**
  * 用内置的邮箱发送邮件
  *
  * $mpid
  * $subject string
  * $content string HTML格式
  * $to 收件人的邮箱
  */
 protected function send_email($mpid, $subject, $content, $to)
 {
     $features = $this->model('mp\\mpaccount')->getFeatures($mpid);
     if (!empty($features->admin_email) && !empty($features->admin_email_pwd) && !empty($features->admin_email_smtp)) {
         $smtp = $features->admin_email_smtp;
         $port = $features->admin_email_port;
         $email = $features->admin_email;
         $pwd = $this->model()->encrypt($features->admin_email_pwd, 'DECODE', $mpid);
     } else {
         /**
          * todo 是否考虑去掉?
          */
         $smtp = 'smtp.163.com';
         $port = 25;
         $email = '*****@*****.**';
         $pwd = 'p0o9i8u7';
     }
     if (defined('SAE_MYSQL_DB')) {
         // sae
         $mail = new \SaeMail();
         if ($mail->setOpt(array('from' => $email, 'to' => $to, 'subject' => $subject, 'content' => $content, 'content_type' => 'HTML', 'smtp_host' => $smtp, 'smtp_port' => $port, 'smtp_username' => $email, 'smtp_password' => $pwd, 'tls' => false))) {
             if (!$mail->send()) {
                 return '邮件发送错误(' . $mail->errno() . '):' . $mail->errmsg();
             }
         } else {
             return '邮件参数设置错误(' . $mail->errno() . '):' . $mail->errmsg();
         }
     } else {
         require_once dirname(dirname(__FILE__)) . '/lib/mail/SmtpMail.php';
         $smtp = new \SmtpMail($smtp, $port, $email, $pwd);
         $smtp->send($email, $to, $subject, $content);
     }
     return true;
 }
Example #9
0
/**
 * SAE邮件发送函数
 * @param string $to 接收邮件者邮箱
 * @param string $name 接收邮件者名称
 * @param string $subject 邮件主题
 * @param string $body 邮件内容
 * @param string $attachment 附件列表
 * @茉莉清茶 57143976@qq.com
 */
function sae_mail($to = '', $subject = '', $body = '', $name = '')
{
    $site_name = modC('WEB_SITE_NAME', L('_OPENSNS_OPEN_SOURCE_SOCIAL_SYSTEM_'), 'Config');
    if ($to == '') {
        $to = C('MAIL_SMTP_CE');
        //邮件地址为空时,默认使用后台默认邮件测试地址
    }
    if ($name == '') {
        $name = $site_name;
        //发送者名称为空时,默认使用网站名称
    }
    if ($subject == '') {
        $subject = $site_name;
        //邮件主题为空时,默认使用网站标题
    }
    if ($body == '') {
        $body = $site_name;
        //邮件内容为空时,默认使用网站描述
    }
    $mail = new SaeMail();
    $mail->setOpt(array('from' => C('MAIL_SMTP_USER'), 'to' => $to, 'smtp_host' => C('MAIL_SMTP_HOST'), 'smtp_username' => C('MAIL_SMTP_USER'), 'smtp_password' => C('MAIL_SMTP_PASS'), 'subject' => $subject, 'content' => $body, 'content_type' => 'HTML'));
    $ret = $mail->send();
    return $ret ? true : $mail->errmsg();
    //返回错误信息
}
Example #10
0
}*/
require 'dblink.php';
header("Content-Type: text/html; charset=utf-8");
$toaddress = $_GET['address'];
$content = $_GET['content'];
$newpass = $_GET['newpass'];
$sql = "select mail from buser where mail='{$toaddress}'";
$nsql = "update buser set password='******' where mail='{$toaddress}'";
$te = new dblink();
$mail = new SaeMail();
$findconf = array('from' => '*****@*****.**', 'to' => $toaddress, 'smtp_host' => 'smtp.qq.com', 'smtp_port' => 25, 'smtp_username' => '*****@*****.**', 'smtp_password' => 'mail1993', 'subject' => '课程助手密码找回', 'content' => '<b>欢迎使用课程助手:</b><hr>你正在进行课程助手用户密码找回操作,验证码为:<font color="#ff0000">' . $content . '</font>,如非本人操作,那么你就可以忽略此邮件了啦。<br/><br/>课程助手<br/><a href="http://simplesky.sinaapp.com">http://simplesky.sinaapp.com</a>', 'content_type' => 'HTML', 'nickname' => '课程助手');
$updateconf = array('from' => '*****@*****.**', 'to' => $toaddress, 'smtp_host' => 'smtp.qq.com', 'smtp_port' => 25, 'smtp_username' => '*****@*****.**', 'smtp_password' => 'mail1993', 'subject' => '课程助手密码重置成功', 'content' => '<b>欢迎使用课程助手:</b><hr>你的课程助手用户密码已经成功重置了啦。<br/><br/>课程助手<br/><a href="http://simplesky.sinaapp.com">http://simplesky.sinaapp.com</a>', 'content_type' => 'HTML', 'nickname' => '课程助手');
if (count($te->dbquery($sql)) != 0) {
    if ($newpass == null) {
        $mail->setOpt($findconf);
        $re = $mail->send();
        if (!$re) {
            echo 'fail';
        } else {
            echo "ok";
        }
    } else {
        if (is_array($te->dbquery($nsql))) {
            echo 'updateok';
            $mail->setOpt($updateconf);
            $mail->send();
        } else {
            echo 'updatefail';
        }
    }
} else {
Example #11
0
$mbody[8] = '紫外线:' . $json['weatherinfo']['index_uv'];
$mbody[9] = '洗车指数:' . $json['weatherinfo']['index_xc'];
$mbody[10] = '旅游指数:' . $json['weatherinfo']['index_tr'];
$mbody[11] = '舒适度指数:' . $json['weatherinfo']['index_co'];
$mbody[12] = '晨练指数:' . $json['weatherinfo']['index_cl'];
$mbody[13] = '晾晒指数:' . $json['weatherinfo']['index_ls'];
$mbody[14] = '鼻斯敏过敏气象指数:' . $json['weatherinfo']['index_ag'];
$mbody[15] = '穿衣指数:' . $json['weatherinfo']['index'];
$mbody[16] = '穿衣建议:' . $json['weatherinfo']['index_d'];
$mbody[17] = '微博:' . '淡淡清香弥漫世界';
//版权,公用时请勿修改!
$mopt['from'] = '*';
//非139已开通SMTP邮箱
$mopt['to'] = '*@139.com';
//139邮箱
$mopt['smtp_host'] = 'smtp.gmail.com';
//SMTP
$mopt['smtp_port'] = 587;
//端口 Gmail:587 其他:25
$mopt['smtp_username'] = '******';
//邮箱帐号
$mopt['smtp_password'] = '******';
//密码
$mopt['subject'] = $json['weatherinfo']['city'] . '天气预报';
$mopt['content'] = $mbody[1] . '<br />' . $mbody[2] . '<br />' . $mbody[3] . '<br />' . $mbody[4] . '<br />' . $mbody[5] . '<br />' . $mbody[6] . '<br />' . $mbody[7] . '<br />' . $mbody[8] . '<br />' . $mbody[9] . '<br />' . $mbody[10] . '<br />' . $mbody[11] . '<br />' . $mbody[12] . '<br />' . $mbody[13] . '<br />' . $mbody[14] . '<br />' . $mbody[15] . '<br />' . $mbody[16] . '<br />' . $mbody[17];
$mopt['content_type'] = 'HTML';
$mopt['tls'] = true;
$mail = new SaeMail();
$mail->setOpt($mopt);
$ret = $mail->send($mopt);
echo $ret;
Example #12
0
 public function verify()
 {
     $res = array();
     $res['Success'] = false;
     $str = '';
     $project = new Project();
     $project->setValue($this->ProjectId);
     if ($this->Action > 0) {
         $keys = array();
         //邮件设置
         $verifyUrl = URL_WEBSITE . "/basic/project_detail.php?id=" . $project->Id . "&selected=2";
         switch ($project->Status) {
             case 1:
                 if ($this->Action == 1) {
                     $project->Status = 2;
                     $str = '需求审核通过;';
                     //设置发送邮件
                     $user = new User();
                     $userMode = $user->getModel($project->UserId);
                     if (!empty($userMode['Email'])) {
                         //发送邮件操作
                         $keys['to'] = $userMode['Email'];
                         $keys['cc'] = "*****@*****.**";
                         $keys['from'] = "*****@*****.**";
                         $keys['smtp_port'] = "25";
                         $keys['smtp_username'] = "******";
                         $keys['smtp_password'] = "******";
                         $mailsubject = "您的技术开发需求已通过事业部审核:" . $project->Subject;
                         $mailbody = "Dear " . $userMode['Name'];
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "您好,您提交的技术开发需求,已经通过事业部审核。接下来的环节是技术部的审核。详情请点击:";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                         $keys['subject'] = $mailsubject;
                         $keys['content'] = $mailbody;
                         $keys['content_type'] = 'HTML';
                         $keys['smtp_host'] = "smtp.qq.com";
                     }
                 } else {
                     $project->Status = 18;
                     $str = '需求驳回;';
                     //设置发送邮件
                     $user = new User();
                     $userMode = $user->getModel($project->UserId);
                     if (!empty($userMode['Email'])) {
                         //发送邮件操作
                         $keys['to'] = $userMode['Email'];
                         $keys['from'] = "*****@*****.**";
                         $keys['smtp_port'] = "25";
                         $keys['smtp_username'] = "******";
                         $keys['smtp_password'] = "******";
                         $mailsubject = "您的技术开发需求已被驳回:" . $project->Subject;
                         $mailbody = "Dear " . $userMode['Name'];
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "您好,您提交的技术开发需求,事业部审核不通过,已被驳回。详情请点击:";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                         $keys['subject'] = $mailsubject;
                         $keys['content'] = $mailbody;
                         $keys['content_type'] = 'HTML';
                         $keys['smtp_host'] = "smtp.qq.com";
                     }
                 }
                 break;
             case 2:
                 if ($this->Action == 1) {
                     $project->Status = 3;
                     $str = '开发审核通过;';
                     $project->Developer = $this->Developer;
                     $developer = new Developer();
                     //单独设置开发人员
                     //$this->DeveloperIds;
                     //删除原来的。
                     $developer->deleteByProjectId($project->Id);
                     //分割插入
                     $arrIds = explode(' ', $this->DeveloperIds);
                     for ($i = 0; $i < count($arrIds); $i++) {
                         $developer->ProjectId = $project->Id;
                         $developer->UserId = $arrIds[$i];
                         if (empty($developer->UserId)) {
                             continue;
                         }
                         $developer->add();
                     }
                     //设置发送邮件
                     $user = new User();
                     $userMode = $user->getModel($project->UserId);
                     if (!empty($userMode['Email'])) {
                         //发送邮件操作
                         $keys['to'] = $userMode['Email'];
                         $keys['from'] = "*****@*****.**";
                         if ($project->Department == 101) {
                             //大客户事业部需要抄送
                             $keys['cc'] = 'ericzhang@thindov.com,orien.young@thindov.com,endertan@thindov.com,sauwe@qq.com';
                         }
                         $keys['smtp_port'] = "25";
                         $keys['smtp_username'] = "******";
                         $keys['smtp_password'] = "******";
                         $mailsubject = "您的技术开发需求已通过技术部审核:" . $project->Subject;
                         $mailbody = "Dear " . $userMode['Name'];
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "您好,您提交的技术开发需求,已经通过技术部审核。本次开发对接人为:" . $this->Developer . ",如有疑问,可与其联系。接下来是设计环节,客户确认好设计稿之后,请及时到以下链接更新项目状态:";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                         $keys['subject'] = $mailsubject;
                         $keys['content'] = $mailbody;
                         $keys['content_type'] = 'HTML';
                         $keys['smtp_host'] = "smtp.qq.com";
                     }
                 } else {
                     $project->Status = 19;
                     $str = '开发需求驳回;';
                     //设置发送邮件
                     $user = new User();
                     $userMode = $user->getModel($project->UserId);
                     if (!empty($userMode['Email'])) {
                         //发送邮件操作
                         $keys['to'] = $userMode['Email'];
                         $keys['from'] = "*****@*****.**";
                         $keys['smtp_port'] = "25";
                         $keys['smtp_username'] = "******";
                         $keys['smtp_password'] = "******";
                         $mailsubject = "您的技术开发需求已被驳回:" . $project->Subject;
                         $mailbody = "Dear " . $userMode['Name'];
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "您好,您提交的技术开发需求,技术部审核不通过,已被驳回。详情请点击:";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                         $keys['subject'] = $mailsubject;
                         $keys['content'] = $mailbody;
                         $keys['content_type'] = 'HTML';
                         $keys['smtp_host'] = "smtp.qq.com";
                     }
                 }
                 break;
             case 3:
                 if ($this->Action == 1) {
                     $project->Status = 4;
                     $str = '客户已确认设计稿;';
                     //设置发送邮件
                     //发送邮件操作
                     $keys['to'] = '*****@*****.**';
                     $keys['from'] = "*****@*****.**";
                     $keys['smtp_port'] = "25";
                     $keys['smtp_username'] = "******";
                     $keys['smtp_password'] = "******";
                     $mailsubject = "设计稿客户已经确认:" . $project->Subject;
                     $mailbody = "Dear " . $userMode['Name'];
                     $mailbody .= "<br />";
                     $mailbody .= "<br />";
                     $mailbody .= "您好,设计已经完成,可进入开发阶段。详情请点击:";
                     $mailbody .= "<br />";
                     $mailbody .= "<br />";
                     $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                     $mailbody .= "<br />";
                     $mailbody .= "<br />";
                     $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                     $mailbody .= "<br />";
                     $mailbody .= "<br />";
                     $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                     $keys['subject'] = $mailsubject;
                     $keys['content'] = $mailbody;
                     $keys['content_type'] = 'HTML';
                     $keys['smtp_host'] = "smtp.qq.com";
                 }
                 break;
             case 4:
                 if ($this->Action == 1) {
                     $project->Status = 5;
                     $str = '开发已完成;';
                     //设置发送邮件
                     $user = new User();
                     $userMode = $user->getModel($project->UserId);
                     if (!empty($userMode['Email'])) {
                         //发送邮件操作
                         $keys['to'] = $userMode['Email'];
                         $keys['from'] = "*****@*****.**";
                         if ($project->Department == 101) {
                             //大客户事业部需要抄送
                             $keys['cc'] = 'ericzhang@thindov.com,orien.young@thindov.com,endertan@thindov.com,sauwe@qq.com';
                         }
                         $keys['smtp_port'] = "25";
                         $keys['smtp_username'] = "******";
                         $keys['smtp_password'] = "******";
                         $mailsubject = "您提交的技术开发需求,已经开发完成:" . $project->Subject;
                         $mailbody = "Dear " . $userMode['Name'];
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "您好,您提交的技术开发需求,技术已开发完成,可以进入测试阶段。请安排人协助测试验收。如有问题请及时反馈给相关开发人员。测试完毕,请到以下链接及时更改为上线状态:";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                         $keys['subject'] = $mailsubject;
                         $keys['content'] = $mailbody;
                         $keys['content_type'] = 'HTML';
                         $keys['smtp_host'] = "smtp.qq.com";
                     }
                 }
                 break;
             case 5:
                 if ($this->Action == 1) {
                     $project->Status = 6;
                     $str = '测试已完成;';
                     //设置发送邮件
                     $user = new User();
                     $userMode = $user->getModel($project->UserId);
                     if (!empty($userMode['Email'])) {
                         //发送邮件操作
                         $keys['to'] = $userMode['Email'] . ';sauweweng@thindov.com';
                         if ($project->Department == 101) {
                             //大客户事业部需要抄送
                             $keys['cc'] = 'ericzhang@thindov.com,orien.young@thindov.com,endertan@thindov.com,sauwe@qq.com';
                         }
                         $keys['from'] = "*****@*****.**";
                         $keys['smtp_port'] = "25";
                         $keys['smtp_username'] = "******";
                         $keys['smtp_password'] = "******";
                         $mailsubject = "测试已经完成,活动已上线:" . $project->Subject;
                         $mailbody = "Dear " . $userMode['Name'];
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "您好,测试已经完成,活动已经上线。请在活动结束时及时到以下链接更新状态,并做效果的总结登记:";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "<a href='" . $verifyUrl . "'>" . $verifyUrl . "</a>";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "——深圳尚道微营销有限公司  技术中心";
                         $mailbody .= "<br />";
                         $mailbody .= "<br />";
                         $mailbody .= "该邮件由“技术开发管理平台”系统发出,无需回复。";
                         $keys['subject'] = $mailsubject;
                         $keys['content'] = $mailbody;
                         $keys['content_type'] = 'HTML';
                         $keys['smtp_host'] = "smtp.qq.com";
                     }
                 }
                 break;
             case 6:
                 if ($this->Action == 1) {
                     $project->Status = 7;
                     $str = '项目已经结束;';
                 }
                 break;
         }
         $project->update();
     } else {
         $project->Developer = $this->Developer;
         $developer = new Developer();
         //单独设置开发人员
         //$this->DeveloperIds;
         //删除原来的。
         $developer->deleteByProjectId($project->Id);
         //分割插入
         $arrIds = explode(' ', $this->DeveloperIds);
         for ($i = 0; $i < count($arrIds); $i++) {
             $developer->ProjectId = $project->Id;
             $developer->UserId = $arrIds[$i];
             if (empty($developer->UserId)) {
                 continue;
             }
             $developer->add();
         }
         $project->update();
     }
     $memo = new Memo();
     $memo->ProjectId = $this->ProjectId;
     $memo->CreateTime = date('Y-m-d H:i:s');
     $memo->Memo = $str . $this->Memo;
     $memo->UserId = $_SESSION['userid'];
     $result = $memo->add();
     if ($result > 0) {
         $res['Success'] = true;
         $res['Message'] = "保存成功";
         $res['Memo'] = $memo->Memo;
         $res['Name'] = $_SESSION['username'];
         $res['CreateTime'] = $memo->CreateTime;
         $res['NewId'] = $result;
         $res['Status'] = $project->Status;
         //发送邮件
         $mail = new SaeMail();
         $mail->setOpt($keys);
         $ret = $mail->send();
         //if ($ret === false)
         //var_dump($mail->errno(), $mail->errmsg());
         $mail->clean();
     } else {
         $res['Success'] = false;
         $res['Message'] = "操作失败,请联系技术部";
     }
     echo json_encode($res);
     exit;
 }
Example #13
0
//send the message, check for errors

if (!$mail->send()) {
    echo 'fail';
} else {
    echo "ok";
}
    
}
else
{
    echo 'foundsame';
}*/
require 'dblink.php';
header("Content-Type: text/html; charset=utf-8");
$toaddress = $_GET['address'];
$content = $_GET['content'];
$sql = "select mail from buser where mail='{$toaddress}'";
$te = new dblink();
$mail = new SaeMail();
if (count($te->dbquery($sql)) == 0) {
    $findconf = array('from' => '*****@*****.**', 'to' => $toaddress, 'smtp_host' => 'smtp.qq.com', 'smtp_port' => 25, 'smtp_username' => '*****@*****.**', 'smtp_password' => 'mail1993', 'subject' => '注册课程助手用户验证', 'content' => '<b>欢迎使用课程助手:</b><hr>你正在进行邮箱注册验证,验证码为:<font color="#ff0000">' . $content . '</font>,如非本人操作,那么你就可以忽略此邮件了啦。<br/><br/>课程助手<br/><a href="http://simplesky.sinaapp.com">http://simplesky.sinaapp.com</a>', 'content_type' => 'HTML', 'nickname' => '课程助手');
    $mail->setOpt($findconf);
    if (!$mail->send()) {
        echo 'fail';
    } else {
        echo "ok";
    }
} else {
    echo 'foundsame';
}