$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。请帮帮我
答案 0 :(得分:0)
试试这个
$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();