[英]Codeigniter Email Sending Issue
這是鏈接: 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
);
是我唯一能看到的東西
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.