【发布时间】:2012-10-20 15:12:58
【问题描述】:
我不知道我在哪里做错了。我只关注 codeIgniter 用户指南。我粘贴控制器的代码......
function do_upload()
{
$config['upload_path'] = 'C:\xampp\htdocs\upload\application';
$config['allowed_types'] = 'doc|docx|pdf';
$config['max_size'] = '10240';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
echo "Resume Successfully uploaded to database.............";
}
$file = $data['upload_data']['full_path'];
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '****************', // change it to yours
'smtp_pass' => '******', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('*************'); // change it to yours
$this->email->to('***************'); // change it to yours
$this->email->subject('Email using Gmail.');
$this->email->message('Working fine ! !');
if($this->email->send())
{
echo 'Email sent.';
}
else
{
show_error($this->email->print_debugger());
}
}
遇到以下 SMTP 错误:185667876 无法找到 套接字传输“ssl” - 您是否忘记启用它 配置PHP?无法发送数据:AUTH LOGIN 发送 AUTH 失败 登录命令。错误:无法发送数据:MAIL FROM:
来自:遇到以下 SMTP 错误:无法发送数据: RCPT 收件人:
to:遇到以下 SMTP 错误:无法发送数据: 数据
数据:遇到以下 SMTP 错误:无法发送数据: 用户代理:CodeIgniter 日期:2012 年 10 月 31 日,星期三 08:36:21 +0100 来自: 返回路径:收件人:test@example.com 主题: =?iso-8859-1?Q?Email_using_Gmail.?= Reply-To: "test@example.com" X-Sender: test@example.com X-Mailer:CodeIgniter X-Priority:3 (正常)消息 ID: Mime 版本:1.0 内容类型:多部分/替代;边界="B_ALT_5090d4f5df7d8" 这是 MIME 格式的多部分消息。您的电子邮件应用程序 可能不支持这种格式。 --B_ALT_5090d4f5df7d8 内容类型: 文本/纯文本; charset=iso-8859-1 内容传输编码:8 位工作 美好的 ! ! --B_ALT_5090d4f5df7d8 内容类型:文本/html; charset=iso-8859-1 内容传输编码:引用打印工作 美好的 ! ! --B_ALT_5090d4f5df7d8-- 无法发送数据:.
遇到以下 SMTP 错误:无法使用以下方式发送电子邮件 PHP SMTP。您的服务器可能未配置为使用此功能发送邮件 方法。
【问题讨论】:
-
有什么错误或其他需要考虑的吗?
-
调试器的错误太多了............
-
我在我的问题中添加了错误......
-
需要在php中安装
openssl -
'smtp_host' => 'smtp.googlemail.com',
标签: php codeigniter