这是链接:http://theartvalley.com/clients/theartvalley.com/
我在电子邮件发送代码中使用了这个:
<?php
include_once (dirname(__FILE__) . "/load_pages.php");
class Generalfunctions extends Load_pages
{
function __construct()
{
parent::__construct();
}
function send_mail(){
$smtp_host = "uscentral48.myserverhosts.com";
$smtp_port = 465;
$smtp_user = "admin@theartvalley.com";
$smtp_pass = "sender33";
$send_email = "gnkafridi@gmail.com";
$config = Array(
"protocol" => "smtp",
"smtp_host" => $smtp_host,
"smtp_port" => $smtp_port,
"smtp_user" => $smtp_user,
"smtp_pass" => $smtp_pass,
"smtp_crypto" => "ssl",
"mailtype" => "html",
"charset" => "iso-8859-1",
"wordwrap" => TRUE,
"wordwrap" => "\r\n" //use double quotes to comply with RFC 822
);
$name = $this->input->post("name");
$email = $this->input->post("email");
$subj = $this->input->post("subj");
$msg = $this->input->post("msg");
$this->load->library("email", $config);
$this->email->from($email, $name);
$this->email->to($send_email);
$this->email->subject($subj);
$this->email->message($msg);
if($this->email->send()){ echo "Your message has successfully send to appropriate email ($send_email)"; }
else{ echo "Server has busy, please send email manually into $send_email"; }
}
}
这告诉我错误:
A PHP Error was encountered
Severity: Warning
Message: fgets() [function.fgets]: SSL: Connection reset by peer
Filename: libraries/Email.php
Line Number: 1870
A PHP Error was encountered
Severity: Warning
Message: fwrite() [function.fwrite]: SSL: Broken pipe
Filename: libraries/Email.php
Line Number: 1847
A PHP Error was encountered
Severity: Warning
Message: fwrite() [function.fwrite]: SSL operation failed with code 1. OpenSSL Error messages: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
Filename: libraries/Email.php
Line Number: 1847
最佳答案
我不明白你为什么需要另一个库并扩展它。
$config = Array(
"protocol" => "smtp",
"smtp_host" => $smtp_host,
"smtp_port" => $smtp_port,
"smtp_user" => $smtp_user,
"smtp_pass" => $smtp_pass,
"smtp_crypto" => "ssl",
"mailtype" => "html",
"charset" => "iso-8859-1",
"wordwrap" => TRUE,
"wordwrap" => "\r\n" //use double quotes to comply with RFC 822
);
你需要改成
$config = Array(
"protocol" => "smtp",
"smtp_host" => $smtp_host,
"smtp_port" => $smtp_port,
"smtp_user" => $smtp_user,
"smtp_pass" => $smtp_pass,
"smtp_crypto" => "ssl",
"mailtype" => "html",
"charset" => "iso-8859-1",
"wordwrap" => TRUE,
"crlf" => "\r\n" //use double quotes to comply with RFC 822
);
这是我唯一能看到的东西
关于php - Codeigniter 电子邮件发送问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36728972/