【问题标题】:codeigniter customer contact formcodeigniter 客户联系表
【发布时间】:2018-12-19 03:13:20
【问题描述】:

您好,我正在使用 Windows 7 和在线服务器。我希望访问者通过联系表单向我发送 mesaj,但是当我单击提交按钮时出现问题。

这是我的控制器;

public function ilet(){
        $name    = $this->input->post("name");
        $email   = $this->input->post("email");
        $message = $this->input->post("message");

        $config = array(
            "protocol"    => "smtp",
            "smtp_host"   => "smtp.gmail.com",
            "smtp_port"   =>"587",
            "smtp_user"   =>"dcugurel7@gmail.com",
            "smtp_password"   =>"*******",
            "starttls"    =>true,
            "charset"     =>"utf-8",
            "mailtype"    =>"html",
            "wordwrap"    => true,
            "newline"     =>"\r\n",
        );

        $this->load->library("email", $config);

         $this->email->from("cugurel7@gmail.com");
         $this->email->to("cugurel7@gmail.com");             
         $this->email->subject("Müşteri bilgi mesajı");
         $this->email->message("Kişinin Adı - " . $name .
          " - Kişinin Email Adresi - " . $email . " - Kişinin Mesajı - " . $message);


         $send = $this->email->send();

         if($send)
         {
             echo "Mail gönderme işlemi başarılı";
         }
         else {
             echo "Başarısız<br>;";

             echo $this->email->print_debugger();

         }


    }

当我点击提交按钮时,服务器会这样说;

220 smtp.gmail.com ESMTP y189-v6sm1286718wmd.19 - gsmtp 您好:250-smtp.gmail.com 为您服务,[185.85.237.26] 250 尺寸 35882577 250-8BITMIME 250-STARTTLS 250 增强状态代码 250-流水线 250 分块 250 SMTPUTF8 发送 AUTH LOGIN 命令失败。错误:530 5.7.0 必须先发出 STARTTLS 命令。 y189-v6sm1286718wmd.19 - gsmtp

无法使用 PHP SMTP 发送电子邮件。您的服务器可能未配置为使用此方法发送邮件。

你能帮我解决这个问题吗?

【问题讨论】:

    标签: codeigniter email


    【解决方案1】:

    你的连接代码可能不正确,看看这个帖子试试这个 - Send email using the GMail SMTP server from a PHP page

    【讨论】:

    • 不,先生。昨晚我使用Windows 10,它是成功的。 :(
    • 在 win 10 上再试一次(作为健全性检查以验证您的代码仍然有效)这是新的 win 7 安装吗?暂时禁用防火墙,尽量让你的 win 7 环境与你的 win 10 匹配
    猜你喜欢
    • 2011-06-17
    • 1970-01-01
    • 2011-06-03
    • 2015-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-11
    相关资源
    最近更新 更多