匿名質問者

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;
}

回答の条件
  • 1人5回まで
  • 登録:
  • 終了:2014/03/15 23:05:03

回答0件)

回答はまだありません

コメントはまだありません

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

「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません