/* メール送信設定 */
// SMTP送信する
-Configure::write('Qdmailer', array(
- 'smtp' => false,
- 'smtpLoglevelLink' => false,
-));
+Configure::write('Qdmailer.smtp', false);
+
// SMTP設定
// SMTP AUTH(認証が必要)
-Configure::write('Qdmailer', array('smtpServer' => array(
+Configure::write('Qdmailer.smtpServer', array(
'user' => 'username',
'pass' => 'password',
'host' => 'host',
'port' => 587,
- 'from' => 'from@address',
+ 'from' => 'from Address',
'protocol' => 'SMTP_AUTH',
-)));
-
+));
// POP Before SMTP(送信前認証が必要)
/*
-Configure::write('Qdmailer', array('smtpServer' => array(
+Configure::write('Qdmailer.smtpServer', array(
'user' => 'username',
'pass' => 'password',
'host' => 'host',
'port' => 587,
- 'from' => 'from@address',
+ 'from' => 'from Address',
'protocol'=>'POP_BEFORE',
- 'pop_host' =>'host',
- 'pop_user' => 'username',
- 'pop_pass'=>'password',
-)));
+ 'pop_host' =>'pop_host',
+ 'pop_user' => 'pop_username',
+ 'pop_pass'=> 'pop_password',
+));
*/
/*
Configure::write('Qdmailer', array(
'is_qmail' => false,
'smtp' => false,
- 'smtpLoglevelLink' => false,
+ 'smtpLoglevelLink' => true,
+ 'errorDisplay' => false,
'logLevel' => 1,
'logFilename' => 'qdmailer.log',
'errorlogLevel' => 2,
return false;
}
+ // SMTP
+ $config = Configure::read('Qdmailer');
+ if ($config['smtp']) {
+ $this->smtp(true);
+ $this->smtpServer($config['smtpServer']);
+ }
+
+ // エラー処理
+ $this->errorDisplay(false);
+
$options = array_merge(array(
- 'from' => $this->site_configs['Site.adminAddress']['value'],
- 'replyto' => $this->site_configs['Site.adminAddress']['value'],
+ 'from' => Configure::read('Site.adminAddress'),
+ 'replyto' => Configure::read('Site.adminAddress'),
+ 'mtaOption' => '-f '.Configure::read('Site.adminAddress'),
'cc' => '',
'bcc' => '',
- 'mtaOption' => '-f '.$this->site_configs['Site.adminAddress']['value'],
), $options);
- $this->to($to, 'Recipient Name');
- $this->from($options['from'], 'Sender Name');
+ $this->to($to);
+ $this->from($options['from']);
$this->replyto($options['replyto']);
+ $this->mtaOption($options['mtaOption']);
if (!empty($options['cc'])) {
$this->cc($options['bcc']);
}
if (!empty($options['bcc'])) {
$this->bcc($options['bcc']);
}
+ $this->kana(true);
$this->subject($subject);
$this->cakeText($body);