匿名質問者匿名質問者回答ポイント なしウォッチ

fuelphp1.6でパッケージについているemailオブジェクトを使って送信するときの質問です。


メール送信処理はできているのですが、
下記の最後の(pclose($handle) === -1)で例外がなげられてしまいます。

ちなみに、popenの実行コマンドは、以下のようになっていました
/usr/sbin/sendmail -oi -f test@gmail.com -t

ハンドルは resource id='84' type='Unknown' です。

type='Unkown'のため、pcloseできないのでしょうか。

お手数をお掛けしますがよろしくお願い致します。

問題のソース
=============
protected function _send()
{
// Build the message
$message = $this->build_message();

// Open a connection
$return_path = ($this->config['return_path'] !== false) ? $this->config['return_path'] : $this->config['from']['email'];
$handle = @popen($this->config['sendmail_path'] . " -oi -f ".$return_path." -t", 'w');

// No connection?
if(! is_resource($handle))
{
throw new \SendmailConnectionException('Could not open a sendmail connection at: '.$this->config['sendmail_path']);
}

// Send the headers
fputs($handle, $message['header']);

// Send the body
fputs($handle, $message['body']);

if(pclose($handle) === -1)
{
throw new \SendmailFailedException('Failed sending email through sendmail.');
}

return true;
}

ログインして回答する
回答がありません

この質問へのコメント

コメントはありません

この質問への反応(ブックマークコメント)

質問の情報

登録日時
2014-03-08 23:03:54
終了日時
2014-03-15 23:05:03
回答条件
1人5回まで

この質問のカテゴリ

この質問に含まれるキーワード

Gmail861sendmail214M&A94オブジェクト658

人気の質問

メニュー

PC版