无法通过实时服务器上的 codeigniter 发送邮件
can not send mail via codeigniter on live server
我在Whosebug上试了很多东西还是不能发邮件,可能是我配置不对;代码是 运行 在实时服务器中
public function(){
// configuration
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'my_email',
'smtp_pass' => 'my_password',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => true
);
$this->load->library('email',$config);
$this->email->from('my_email','Administrator');
$this->email->to('my_friends_email');
$this->email->subject($subject);
$this->email->message($message);
return ($this->email->send()); }
试试这个
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxx',
'smtp_pass' => 'xxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
// Set to, from, message, etc.
$result = $this->email->send();
如果您的主机帐户允许使用 SMTP 中继或外部 SMTP,您需要与您的服务器提供商核实。
我在Whosebug上试了很多东西还是不能发邮件,可能是我配置不对;代码是 运行 在实时服务器中
public function(){
// configuration
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'my_email',
'smtp_pass' => 'my_password',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => true
);
$this->load->library('email',$config);
$this->email->from('my_email','Administrator');
$this->email->to('my_friends_email');
$this->email->subject($subject);
$this->email->message($message);
return ($this->email->send()); }
试试这个
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxx',
'smtp_pass' => 'xxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
// Set to, from, message, etc.
$result = $this->email->send();
如果您的主机帐户允许使用 SMTP 中继或外部 SMTP,您需要与您的服务器提供商核实。