public function __construct(Qdmail $qdmail, Exception $previous = NULL)
 {
     $this->stack = $qdmail->errorStatment();
     $msg = "Qdmail error:" . print_r($this->stack, true);
     if ($previous) {
         parent::__construct(s($msg), $previous);
     } else {
         parent::__construct(s($msg));
     }
     foreach ($this->stack as $item) {
         log_error("mail", $item);
     }
 }
 public function handleException($e)
 {
     $this->_exception = $e;
     $mail = new Qdmail();
     $mail->smtp($this->useSmtp);
     $mail->smtpServer($this->smtpParams);
     $mail->to($this->exceptionRecipients);
     $mail->subject($this->subjectPrefix . '[' . date('Ymd H:i:s') . '][' . $this->_getSeverityAsString() . '][' . $this->_getUrl() . '] ' . $this->_exception->getMessage());
     $mail->text($this->_getText());
     $mail->from($this->exceptionFrom);
     $mail->send();
 }
示例#3
0
function mailsender($to, $subject, $body, $fromname, $fromaddress)
{
    //SMTP送信
    $mail = new Qdmail();
    $mail->smtp(true);
    $param = array('host' => 'tls://*********', 'port' => 465, 'from' => '*********@*********', 'protocol' => 'SMTP_AUTH', 'user' => '*********@*********', 'pass' => '*********');
    $mail->smtpServer($param);
    $mail->to($to);
    $mail->subject($subject);
    $mail->from($fromaddress, $fromname);
    $mail->text($body);
    $return_flag = $mail->send();
    return $return_flag;
}
 function handleException($e)
 {
     $this->_exception = $e;
     $mail = new Qdmail();
     $mail->to($this->exceptionRecipients);
     $mail->subject('[' . $this->_getSeverityAsString() . '] ' . $this->_exception->getMessage());
     $mail->text($this->_getText());
     $mail->from(array('*****@*****.**', 'Exception Notifier'));
     $mail->send();
 }
示例#5
0
 function qd_send_mail($type, $to = null, $subject = null, $content = null, $other_header = array(), $attach = null, $debug = 0)
 {
     $type_org = $type;
     $mail =& Qdmail::getInstance();
     $mail->debug = $debug;
     if (!is_array($type)) {
         $type = array('TYPE' => $type);
     }
     list($type, $link) = $mail->keyUpper($type);
     $option = array();
     $return = array();
     $type = array_change_key_case($type, CASE_UPPER);
     $option = isset($type['OPTION']) && is_array($type['OPTION']) ? $type['OPTION'] : array();
     $return = isset($type['RETURN']) && is_array($type['RETURN']) ? $type['RETURN'] : array();
     if (isset($type['SMTP'])) {
         $option = array_merge($option, array('SMTP' => true, 'smtpServer' => $type['SMTP']));
     }
     $type = isset($type['TYPE']) ? $type['TYPE'] : 'text';
     $_type = array('TEXT' => 'Text', 'HTML' => 'Html', 'DECO' => 'Deco', 'DECOTEMPLATE' => 'DecoTemplate');
     $easy_method = isset($_type[strtoupper($type)]) ? 'easy' . $_type[strtoupper($type)] : '_';
     if (!method_exists($mail, $easy_method)) {
         $mail->errorGather('Illegal type \'' . $type . '\'', __LINE__);
         return false;
     }
     $ret = $mail->{$easy_method}($to, $subject, $content, $other_header, $attach, $option);
     foreach ($return as $method => $value) {
         if (method_exists($mail, $method)) {
             $type_org[$link['RETURN']][$method] = $mail->{$method}($value);
         }
     }
     if (0 !== count($return)) {
         $type_org[$link['RETURN']]['qd_send_mail'] = $ret;
         $ret = $type_org;
     }
     return $ret;
 }
示例#6
0
            readfile($file_path);
        }
    } else {
        // ファイルが存在しない
        echo h($_GET['file']) . ERROR_FILE_NOT_EXIST;
    }
    exit;
} elseif ($page === 'finish') {
    // -------------------------------------------------------
    // メール送信
    // -------------------------------------------------------
    // ライブラリ読み込み
    require_once DIR_LIB . '/qdmail.php';
    require_once DIR_LIB . '/qdsmtp.php';
    // Qdmailの設定
    $mail = new Qdmail();
    $mail->errorDisplay(false);
    $mail->errorlogPath(DIR_LOGS . '/');
    $mail->errorlogLevel(3);
    $mail->errorlogFilename('qdmail_error.log');
    // Qdsmtpの設定
    $smtp = new QdSmtp();
    $smtp->pop3TimeFilename(DIR_TEMP . '/qdsmtp.time');
    $mail->setSmtpObject($smtp);
    // 宛先
    $to_email = TO_EMAIL;
    // 件名
    $to_subject = TO_SUBJECT;
    // メール本文
    $body = $tmpl->fetch(MAIL_BODY);
    $body = hd($body);
    foreach ($params as $p) {
        $fields[$p] = params($p);
    }
    $res = $CON->autoExecute('applications', $fields, DB_AUTOQUERY_INSERT);
    // workshop increment
    $workshops = array('workshop', 'kids_1_workshop_am', 'kids_1_workshop_pm', 'kids_2_workshop_am', 'kids_2_workshop_pm');
    foreach ($workshops as $workshop) {
        if (isset($_REQUEST[$workshop])) {
            $CON->query("UPDATE workshops SET num = num + 1 WHERE name = ?", array($_REQUEST[$workshop]));
        }
    }
    // application mail
    $app_body = fetch('application.txt.php');
    $app_mail = new Qdmail();
    $app_mail->to(APP_MAIL_TO);
    $app_mail->bcc(APP_MAIL_BCC);
    $app_mail->subject(APP_MAIL_SUBJECT);
    $app_mail->text($app_body);
    $app_mail->from(APP_MAIL_FROM);
    $app_mail->send();
    // application auto reply mail
    $reply_body = fetch('application_auto_reply.txt.php');
    $reply_mail = new Qdmail();
    $reply_mail->to(params('email'));
    $reply_mail->bcc(APP_REPLY_MAIL_BCC);
    $reply_mail->subject(APP_REPLY_MAIL_SUBJECT);
    $reply_mail->text($reply_body);
    $reply_mail->from(APP_REPLY_MAIL_FROM);
    $reply_mail->send();
    redirect('application_created.php');
}
示例#8
0
<?php

//qdmailを使用したメール送信
//必要なファイルをインクルード
require_once './qdsmtp.php';
require_once './qdmail.php';
//ヒアドキュメントを使用
$mailBody = <<<EOT
本文本文本文本文本文本文本文本文本文
本文本文本文本文本文本文本文本文本文
本文本文本文本文本文本文本文本文本文
EOT;
$mail = new Qdmail();
$mail->errorDisplay(FALSE);
$mail->smtpObject()->error_display = FALSE;
$from = "*****@*****.**";
//宛先
$to = "*****@*****.**";
//送信元
$mail->from($from, "Webマスター");
//宛先名
$mail->to($to, "管理者");
//送信元名
$mail->subject("お問合せ");
//件名
$mail->text($mailBody);
//本文
//データを格納する
$param = array("host" => "ssl://smtp.gmail.com", "port" => 465, "from" => "*****@*****.**", "protocol" => "SMTP_AUTH", "user" => "*****@*****.**", "pass" => "rrrr0611");
$mail->smtp(TRUE);
$mail->smtpServer($param);
示例#9
0
文件: form.php 项目: webgoto/amf
 /**
  * メールを送信して結果を返す
  */
 private function mail_send()
 {
     $is_send = true;
     foreach ($this->mails as $mail_info) {
         $mail = new \Qdmail();
         $mail->to($this->replace_placeholder($mail_info['to']));
         $mail->from($this->replace_placeholder($mail_info['from']));
         $mail->subject($this->replace_placeholder($mail_info['subject']));
         $mail->text($this->replace_placeholder($mail_info['body']));
         if (isset($mail_info['cc'])) {
             $mail->cc($this->replace_placeholder($mail_info['cc']));
         }
         if (isset($mail_info['bcc'])) {
             $mail->cc($this->replace_placeholder($mail_info['bcc']));
         }
         if (isset($mail_info['replyto'])) {
             $mail->cc($this->replace_placeholder($mail_info['replyto']));
         }
         if (!$mail->send()) {
             $is_send = false;
         }
     }
     return $is_send;
 }
示例#10
0
	/** 
	 * メール送信
	 * 
	 * メールを送信する<br>
	 * 
	 * @access public
	 * @param string
	 * @return void メールタイプ
	 */
	function send_mail($type="text", $debug=false)
	{
		//メール送信
		$mail = new Qdmail(null, null, null, $debug);
		$mail -> lineFeed("\n");
		$mail->from($this->from, $this->from_name);
		$mail->to($this->to, $this->to_name);
		if (count($this->cc) > 0) $mail->cc($this->cc, $this->cc_name);
		if (count($this->bcc) > 0) $mail->bcc($this->bcc, $this->bcc_name);
		$mail->replyto($this->replyto, $this->replyto_name);
		$mail->subject($this->subject);
		$mail->text($this->message);
		$ret = $mail->send();
		$this->reset();
		return $ret;
	}
示例#11
0
 /**
  *  メールを送信する
  */
 protected function mail_send($mail_address_to, $mail_subject, $mail_content, $mail_address_from = '', $mail_attach_path = '')
 {
     $this->load->library('qdmail');
     $this->load->helper('email');
     if (!valid_email("{$mail_address_to}")) {
         return FALSE;
     }
     if (!$mail_address_from) {
         $mail_address_from = MAIL_ADDRESS_FROM;
     }
     $mail = new Qdmail();
     $mail->to("{$mail_address_to}");
     $mail->subject("{$mail_subject}");
     $mail->text("{$mail_content}");
     $mail->from("{$mail_address_from}");
     if ($mail_attach_path and file_exists($mail_attach_path)) {
         $mail->attach($mail_attach_path);
     }
     $mail->send();
     //qd_send_mail('text',$mail_address_to,"$title",$mail_content,"$mail_address_from");
     return TRUE;
 }
示例#12
0
文件: dlexec.php 项目: big2men/qhm
function dl_sendmail($email, $filename, $title)
{
    global $smtp_auth, $smtp_server, $google_apps, $google_apps_domain;
    $qm = get_qm();
    $xsubject = $title == '' ? $qm->replace('plg_dlbutton.subject', '') : $title;
    $xmsg = $qm->replace('plg_dlbutton.mail_body', $filename);
    $xheader = "From: " . $email . "\n";
    $xparameter = "-f" . $email;
    //Mail send setting
    if ($google_apps && preg_match('/.*' . $google_apps_domain . '$/', $email)) {
        $mail = new Qdmail();
        $mail->smtp(true);
        $param = array('host' => 'ASPMX.L.GOOGLE.com', 'port' => 25, 'from' => $email, 'protocol' => 'SMTP', 'user' => 'root@' . $google_apps_domain, 'pass' => $passwd);
        $mail->smtpServer($param);
        $mail->to($email);
        $mail->subject($xsubject);
        $mail->from($email);
        $mail->text($xmsg);
        $return_flag = $mail->send();
    } else {
        $mail = new SimpleMail();
        $mail->set_params('', $email);
        $mail->set_to('', $email);
        $mail->set_subject($xsubject);
        $mail->send($xmsg);
    }
}
示例#13
0
    public function send_mail()
    {
        //Paramin
        $nick = mb_convert_encoding($_REQUEST['u_name'], "EUC-JP", 'Shift-JIS');
        $invite_name = mb_convert_encoding($_REQUEST['invite_name'], "EUC-JP", 'Shift-JIS');
        $dec_id = $_REQUEST['dec_id'];
        $invite_adr = $_REQUEST['invite_adr'];
        $sql = "SELECT `u_id` from `hanluv_user` ";
        /////仮の値、修正が必要!!
        $sql .= "where `u_subno` = '34'";
        $res = $this->index_model->getAll($sql);
        //■招待元がいれば処理を実行
        if (!empty($res[0][0])) {
            $invite_from = $res[0][0];
            //■招待対象者のアドレス重複チェック
            $sql = "SELECT count(*) from hanluv_user ";
            $sql .= "where u_mail = '{$invite_adr}' ";
            $sql .= "AND  u_cflg =0";
            $res = $this->index_model->getRow($sql);
            //■重複調査結果の判別
            if ($res[0] > 0) {
                //招待元の情報更新
                $sql = "UPDATE `hanluv_user` SET";
                $sql .= "`invite_from` =  '{$invite_from}'";
                $sql .= "WHERE  `u_mail` ='{$invite_adr}';";
                $res = $this->index_model->query($sql);
            } else {
                //招待先の新規登録
                $sql = "INSERT INTO hanluv_user ";
                $sql .= "(u_mail,u_name,invite_from) ";
                $sql .= "VALUES ('{$invite_adr}','hanluv','{$invite_from}')";
                $res = $this->index_model->query($sql);
            }
            //■データの登録
            $ng_check = 0;
            if ($ng_check == 0) {
                //■招待さきIDの取得
                $con = $this->index_model->PDOconnect();
                $sql = "SELECT `u_id` from `hanluv_user` ";
                $sql .= "where `u_mail` = '{$invite_adr}'";
                $res = $this->index_model->getAll($sql);
                $invite_to = $res[0][0];
                //招待元の情報更新
                $sql = "UPDATE  `cp-gag`.`hanluv_user` SET";
                $sql .= "`dec_id` =  '{$dec_id}',`invite_to` =  '{$invite_to}'";
                $sql .= "WHERE  `hanluv_user`.`u_id` ='{$invite_from}';";
                $res = $this->index_model->query($sql);
                //■招待メール
                $mail_key = "invite_mail";
                //診断用URL作成
                $invite_url = 'http://han-love.from.tv';
                //@todo:param settings
                //$invite_url .= '?a='.$invite_from.'&t='.$invite_from.'&guid=ON';
                //かつて同じ組み合わせで招待したことがあるか確認
                $sql = "SELECT count(*) from h_invite ";
                $sql .= "where `invite_from` = {$invite_from} ";
                $sql .= "AND  `invite_to` \t= {$invite_to} ";
                $res = $this->index_model->getRow($sql);
                if ($res[0] < 1) {
                    //招待情報の登録
                    $sql = "INSERT INTO h_invite ";
                    $sql .= "(`invite_id` ,`invite_from` ,`invite_to` ,`invite_comp` ,`invite_time`) ";
                    $sql .= "VALUES (NULL ,  '{$invite_from}',  '{$invite_to}',  '0', CURRENT_TIMESTAMP)";
                    $res = $this->index_model->query($sql);
                }
            } else {
                echo 'duplicate';
            }
        }
        //■メール文章の抽出
        if (empty($mail_key)) {
            //■例外処理
            exit;
        } else {
            $sql = "SELECT\t`s_value` from `system_values` ";
            $sql .= "WHERE \t`s_key` = '{$mail_key}'";
            $res = $this->index_model->getAll($sql);
            $body = $res[0]['s_value'];
        }
        /************************************************/
        /******************  Mail  **********************/
        /************************************************/
        if ($ng_check == 0) {
            //■セクション独自タグの置換
            $body = str_replace("{invite_url}", $invite_url, $body);
            $body = str_replace("{u_name}", $nick, $body);
            $body = str_replace("{invite_name}", $invite_name, $body);
            //$this->load->library('mobmail');
            //■タグ置換
            //$body = $this->index_model->tag_Analyze($body);
            //■メール送信
            //mb_internal_encoding( "EUC-JP");
            $subject = $invite_name . 'さんにオススメの韓流サイト!!';
            require_once 'qdmail.php';
            $mail = new Qdmail();
            $mail->to($invite_adr);
            $mail->subject($subject);
            $mail->text($body);
            $mail->from('test@localhost');
            $mail->send();
        }
        $message = '<font color=#ff0000><b>!</b></font>お友達を招待しました<br /><span style="font-size:xx-small">※ケータイの[戻るボタン]で戻って下さい。</span><br />';
        //指定の韓流スターのプロフィール取得
        $sql = <<<SQL
\t\tSELECT `p_name`
\t\tFROM  `h_profile` 
\t\tWHERE  `p_profid` = '{$dec_id}'
SQL;
        $res = $this->index_model->getAll($sql);
        $p_name = $res[0][0];
        if (empty($dec_id)) {
            header("Location: {$domain}");
        }
        if ($dec_id < 10) {
            $decome_id = '000' . $dec_id;
        }
        if ($dec_id > 9 && $dec_id < 100) {
            $decome_id = '00' . $dec_id;
        }
        if ($dec_id > 99) {
            $decome_id = '0' . $dec_id;
        }
        //$smarty->register_outputfilter('sjis_encoding');
        //ini_set("default_mimetype", "application/xhtml+xml");
        //dataのセット
        $data['message'] = $message;
        $data['u_nick'] = $nick;
        $data['p_name'] = $p_name;
        $data['decome'] = $decome_id;
        //loading view
        $this->load->library('Myemoji');
        $this->load->view('headerview');
        $this->load->view('index_deco', $data);
        $this->load->view('footer_ss');
        //$db->disconnect();
        //■招待元の情報取得
    }
示例#14
0
                $data = array();
                //ループが回るごとにリセット必須
            }
            $sql = 'SELECT user_mail FROM user WHERE user_id = ?';
            $stmt = $dbh->prepare($sql);
            $data[] = $user_id;
            $stmt->execute($data);
            $rec = $stmt->fetch(PDO::FETCH_ASSOC);
            $dbh = null;
            //ヒアドキュメントを使用
            $mailBody = <<<EOT
あなたののランキングに投稿がありました。
【タイトル】
{$y_data['title']}
EOT;
            $mail = new Qdmail();
            $mail->errorDisplay(FALSE);
            $mail->smtpObject()->error_display = FALSE;
            $from = $rec['user_mail'];
            //宛先
            $to = "*****@*****.**";
            //送信元
            $mail->from($from, "RankChannel");
            //宛先名
            $mail->to($to, $user_name);
            //送信元名
            $mail->subject("あなたのランキングに投稿がありました。");
            //件名
            $mail->text($mailBody);
            //本文
            //データを格納する