私のcodeIgniterプロジェクトでは、私は電子メールを送信したい、私は次のメール機能を使用していますが、そのworking.pleaseは役に立ちません。 コントローラーのコードは次のとおりです。ライブサーバー上のCodeIgniterで電子メールを送信する方法
public function mail() {
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxx',
'smtp_pass' => 'xxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$toEmail = "[email protected]";
$mailHeaders = "From: " . $_POST["userName"] . "<br> Email ID:". $_POST["userEmail"] ."\r\n";
if(mail($toEmail, $_POST["Mobile"], $_POST["message"], $mailHeaders)) {
print "<p class='alert alert-success'>Mail Sent.</p>";
} else {
print "<p class='alert alert-danger'>Problem in Sending Mail.</p>";
}
}
エラーは何ですか? –