简体   繁体   English

消息:fsockopen():无法连接到ssl://smtp.gmail.com:465(连接超时)

[英]Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)

i am trying to send email using codeigniter email class but i am getting error Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) 我正在尝试使用codeigniter电子邮件类发送电子邮件,但出现错误消息:fsockopen():无法连接到ssl://smtp.gmail.com:465(连接超时)

public function index()
     {
     $this->load->helper('form');
    $this->load->view('sellerend/seller_signup.php');
       $config = array(
        'protocol' => 'smtp',
        'smtp_host' => 'ssl://smtp.gmail.com',
        'smtp_port' => '465',
        'smtp_user' => 'myemail@gmail.com',
        'smtp_pass' => 'mypassword',
        'mailtype'  => 'html', 
        'charset'   => 'iso-8859-1'
        );

    $this->load->library('email',$config);
    $this->email->initialize($config);
    $this->email->set_newline("\r\n");
    $this->email->from('myemail@gmail.com','my name');
    $this->email->to('ashurenu1993@gmail.com');
    $this->email->message('its working bro');
    if ($this->email->send())
    {
        echo "hi its works";
    }
    else
    {
        show_error($this->email->print_debugger());
    }
}

Go to your gmail account and allow less secure apps under connected apps and sites 转到您的Gmail帐户,并在连接的应用程序和网站下允许安全性较低的应用程序

Change 更改

 $this->load->library('email',$config)
 $this->email->initialize($config);

to

 $this->load->library('email');
 $this->email->initialize($config);

and

 'charset'   => 'iso-8859-1'

to

 'charset'   => 'utf-8'

使用PHP Mailer并转到您的Gmail帐户并允许安全性较低的应用示例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决错误:消息:fsockopen():无法连接到 ssl://smtp.gmail.com:465(连接被拒绝) - How to resolve the error: Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) 在Codeigniter中无法发送电子邮件-fsockopen():无法连接到ssl://smtp.gmail.com:465(连接被拒绝) - in Codeigniter Unable to send email - fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) Laravel 3-错误:与smtp.gmail.com的连接:465超时 - Laravel 3 - error: Connection to smtp.gmail.com:465 Timed Out [SMTP:无法连接套接字:fsockopen():无法连接至ssl://smtp.gmail.com:465(未知错误)(代码:-1,响应:)] - [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) (code: -1, response: )] Connection could not be established with host smtp.gmail.com:stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 - Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 连接失败。 错误 #2:stream_socket_client():无法连接到 ssl://smtp.gmail.com:465(连接被拒绝) - Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) AbstractSmtpTransport.php第404行中的Swift_TransportException:与smtp.gmail.com的连接:465超时 - Swift_TransportException in AbstractSmtpTransport.php line 404: Connection to smtp.gmail.com:465 Timed Out 出现错误fsockopen():使用codeigniter电子邮件类发送电子邮件时,无法连接到smtp.googlemail.com:465(连接超时) - getting error fsockopen(): unable to connect to smtp.googlemail.com:465 (Connection timed out) while sending email using codeigniter email class CodeIgniter电子邮件:fsockopen():无法连接到ssl://smtp.gmail.com托管中 - CodeIgniter email: fsockopen(): Unable to connect to ssl: //smtp.gmail.com in hosting Codeigniter电子邮件无法在服务器fsockopen()中工作:无法连接至ssl://smtp.googlemail.com:465(连接被拒绝) - Codeigniter Email did not Working in Server fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Connection refused)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM