【问题标题】:Email only receive in gmail mail id's .Cannot deliver in others电子邮件仅在 gmail 邮件 ID 中接收。不能在其他人中发送
【发布时间】:2018-08-24 04:17:24
【问题描述】:
    $to_email = "suraj@gmail.com,rajeesh@paarva.com,arun@paarva.com,arunrmt@gmail.com";
    $fname = $this->input->post('fname');
    $lname = $this->input->post('lname');
    $email = $this->input->post('email');
    $mobile = $this->input->post('mobile');
    $msg = $this->input->post('msg');
    $this->email->set_mailtype("html");


    $config = Array(        
        'protocol' => 'sendmail',
       'mailtype'  => 'html', 
        'charset'   => 'iso-8859-1'
    );
    $this->load->library('email',$config);
    $this->email->from($from_email, $fname);
    $this->email->to($to_email);
    $this->email->subject('Contact enquiry' . ' ' . $fname . ' ' . $mobile);

    $email_body = "<table style='width:700px;border:1px #e5e5e5 solid;background:#f5f5f5;color:#000000;padding:7px;'><tbody><tr><td style='width:120px;padding-left:3px;border:1px #FFFFFF solid;background:#f15722;color:#FFF;'><strong>Name:</strong></td><td style='border:1px #e5e5e5 solid; padding:5px;background:#FFFFFF;color:#000000;'>" . $fname . "." . $lname . "</td></tr><tr><td style='width:120px;padding-left:3px;border:1px #FFFFFF solid;background:#f15722;color:#FFF;'><strong>Phone:</strong></td><td style='border:1px #e5e5e5 solid; padding:5px;background:#FFFFFF;color:#000000;'>".$mobile."</td></tr><tr><td style='width:120px;padding-left:3px;border:1px #FFFFFF solid;background:#f15722;color:#FFF;'><strong>Email Id:</strong></td><td style='border:1px #e5e5e5 solid; padding:5px;background:#FFFFFF;color:#000000;'>".$email."</td></tr><tr><td style='width:120px;padding-left:3px;border:1px #FFFFFF solid;background:#f15722;color:#FFF;'><strong>Message:</strong></td><td style='border:1px #e5e5e5 solid;padding:7px;background:#FFFFFF;color:#000000;line-height:19px;'>".$msg."</td></tr></tbody></table>"; 
    $body = str_replace("\n", "<br/>", "$email_body");
    $this->email->message($email_body);


    if ($this->email->send()) {
        //echo $body;
        echo 'Email sent successfully'; 
    } else {
        echo 'Error in sending Email';
    }
}

电子邮件仅发送到 gmail id,例如:suraj@gmail.com,arunmt@gmail.com。并且邮件不会在电子邮件 ID 中收到,例如 rajeesh@paarva.com,ajeeb@paarva.com。请帮帮我

【问题讨论】:

  • 在配置数组中也给mailpath试试。
  • 如何配置mauilpath
  • 为什么你使用协议作为sendmail
  • 我正在使用此协议.. 是否有任何问题
  • 你可以使用默认的mail。试试这个link

标签: php html .net ajax codeigniter


【解决方案1】:

试试这个

            $this->email->initialize(array(
              'protocol' => protocol,
              'smtp_host' => host,
              'smtp_user' => user,
              'smtp_pass' => password,
              'smtp_port' => smtp port,
              'crlf' => "\r\n",
              'newline' => "\r\n"
            ));

            $this->email->email, 'eJobs');
            $this->email->to(email);
            $this->email->subject('subject');
            $this->email->message("you're message");
            $this->email->send();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-19
    • 1970-01-01
    • 2023-03-13
    • 2018-03-07
    • 1970-01-01
    • 2011-05-18
    • 1970-01-01
    相关资源
    最近更新 更多