-1
我使用笨與WAMP爲的LocalServer發送電子郵件,我寫發送電子郵件代碼無法通過笨
$config = array(
'protocol'=>'smtp',
'smtp_port'=>'465',
'smtp_host'=>'ssl://smtp.googlemail.com',
'smtp_user'=>'[email protected]',
'smtp_pass'=>'*********'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");//set the new line rule
$this->email->from('[email protected]', 'Imran Tufail');
$this->email->to('[email protected]');
$this->email->subject('Email Test');
$this->email->message("The stuff works");
if($this->email->send())
{
echo "Mail sent ";
}
else{
echo $this->email->print_debugger();
}
}
此代碼生成錯誤
A PHP Error was encountered
Severity: Warning
Message: 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?)
文件名:庫/郵件。 php
行號:1869
遇到以下SMTP錯誤: 1706213911無法找到套接字傳輸「ssl」 - 您是否忘記在配置PHP時啓用它?
沒有解決您的問題或仍ü需要任何幫助.......... –
thnx venkat我的問題已解決 –