<?php
class Email extends Controller {
function Email()
{
parent::Controller();
$this->load->library('email');
}
function index()
{
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '7';
$config['smtp_user'] = 'mygmail@gmail.com';
$config['smtp_pass'] = '*******';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['mailtype'] = 'text'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not
$this->email->initialize($config);
$this->email->from('mygmail@gmail.com', 'myname');
$this->email->to('target@gmail.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
$this->load->view('email_view');
}
}
Ben bu hatayı alıyorum:
A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)
Filename: libraries/Email.php
Line Number: 1641
Kullanma PORT 25/587
Ben bu hata var:
A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:func(119):reason(252)
Filename: libraries/Email.php
Line Number: 1641
Ben şimdi PHPMailer kullanmak istemiyorum. (Aslında PHPMailer kullanmayı denedi, ama başarısız oldu).
Nasıl bu sorunu çözmek mi beyler?