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');
}
示例#2
0
     $from_email = $_POST[AUTO_REPLY_EMAIL];
 } else {
     $from_email = $to_email;
 }
 // メール送信内容
 $mail->to($to_email);
 $mail->subject($to_subject);
 $mail->text($body);
 $mail->from($from_email);
 // CCメールアドレスの設定がある場合
 if (CC_EMAIL !== '') {
     $mail->cc(CC_EMAIL);
 }
 // BCCメールアドレスの設定がある場合
 if (BCC_EMAIL !== '') {
     $mail->bcc(BCC_EMAIL);
 }
 // 添付ファイル機能を利用する場合
 if (FILE) {
     foreach ($files as $file) {
         $attach[] = array('PATH' => DIR_TEMP . '/' . $file['tmp_name'], 'NAME' => $file['name']);
     }
     if (isset($attach)) {
         $mail->attach($attach);
     }
 }
 // 外部SMTPを利用する場合
 if (SMTP) {
     $mail->smtp(true);
     $mail->smtpServer(array('host' => SMTP_HOST, 'port' => SMTP_PORT, 'protocol' => SMTP_PROTOCOL, 'user' => SMTP_USER, 'pass' => SMTP_PASSWORD, 'from' => $from_email));
 }
示例#3
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;
	}