![](/img/trans.png)
[英]Unable to send email using PHP mail(). Your server might not be configured to send mail using this method
[英]Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method
无法使用 PHP Sendmail 发送电子邮件。 您的服务器可能未配置为使用此方法发送邮件。
// 配置内容
$protocol = 'sendmail';
$mailpath = '/usr/sbin/sendmail';
$charset = 'iso-8859-1';
$wordwrap = TRUE;
$mailtype= "html";
$smtp_host= "mail.domain.com";//pengaturan smtp
$smtp_port= "465";
$smtp_timeout= "25";
$user = "";
$pass = "";
// 配置数组
$config = array();
$config['protocol'] = $protocol;
$config['mailpath'] = $mailpath;
$config['charset'] = $charset;
$config['wordwrap'] = $wordwrap;
$config['mailtype'] = $mailtype;
$config['smtp_host'] = $smtp_host;
$config['smtp_port'] = $smtp_port;
$config['smtp_timeout'] = $smtp_timeout;
$config['smtp_user'] = $user;
$config['smtp_pass'] = $pass;
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['send_multipart'] = FALSE;
// 发送
$this->email->initialize($config);
$this->email->from($config['smtp_user'], 'Info');
$this->email->to($query['email']);
$this->email->subject("Reset password berhasil");
$this->email->message("adadad");
if ($this->email->send()) {
echo "berhasil";
}
好吧,sendmail 允许您使用安装在本地服务器上的 sendmail 程序发送电子邮件。 您的服务器上是否安装了 sendmail。
您还在配置文件中指定了 SMTP 连接设置。 也许你不需要sendmail。 尝试将协议字段从 sendmail 更改为 smtp。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.