我尝试使用 CodeIgniter 的电子邮件类发送邮件,但它显示了一些错误:
fsockopen() [function.fsockopen]: unable to connect to
ssl://smtp.googlemail.com:465 (Unable to find the socket transport
"ssl" - did you forget to enable it when you configured PHP?)
我的代码在这里:
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = 'myemail.world2010@gmail.com';
$config['smtp_pass'] = 'email';
$this->load->library('email');
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$message="
username:{$this->input->post('username')}
password:{$this->input->post('password')}
";
$this->email->from('sagar.world2010@gmail.com','Admin');
$this->email->to($this->input->post('email'));
$this->email->subject('Activation Message');
$this->email->message($message);
$this->email->send();
echo $this->email->print_debugger();
我也改了php.ini文件并粘贴extension=php_openssl.dll
进去,还是不行。