当“说明”与“附件”一起增加超过3000个字符时,我无法发送电子邮件。这是示例代码。
$mail->IsSMTP( ); //send via SMTP
$mail->Host = SMTP_HOST; //SMTP servers
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Host = SMTP_HOST; //SMTP servers
$mail->Port = 25;
$mail->Username = USER_NAME;
$mail->Password = USER_PWD;
$mail->From = $from_email;
$mail->FromName = $from_name;
$mail->ContentType = "text/html";
$mail->WordWrap = 180; // set word wrap
$mail->CharSet = 'UTF-8';
$mail->IsHTML( true );
$mail->AddAddress( $to_add, $to_name );
$mail->Subject = "Tutorial get Answered";
$HTML = "<p>Your tutorial is ready now,</p>";
$HTML .= "<p>Question ID: " . $q_id. "</p>";
$HTML .= "<p>Question : " . $row['description'] . "</p>";
$HTML .= "<p>Posted on: " . $row['created_on'] . "</p>";
$HTML .= "<p><a href=base_url().'/" . $row['id'] . "/" . my_text($row['description']) . "'>SHOW TUTORIAL</a></p>";
$HTML .= "<p><br><br>Thank you.</p>";
$mail->Body=$HTML;
$mail->Send();
$msg="Mail send into your email";
工作正常对于小描述,但如果描述增加,则会显示已发送的邮件但未显示在收件箱中。
答案 0 :(得分:0)
检查CI Email Library Guide,请使用以下格式:
$this->load->library('email');
$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->set_mailtype('html');
$this->email->send();
这个结构可能会解决你的问题,因为我正在使用这个问题而没有任何问题。
答案 1 :(得分:0)
$email = $this->input->post('email');
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '**********@gmail.com',
'smtp_pass' => '********',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
//send email with #temp_pass as a link
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('*********@gmail.com', "Name");
$this->email->to($email);
$this->email->subject("Reset your Password");
$message = "<p>****************</p>";
$message. = "<p>****************</p>";
$this->email->message($message);
$this->email->send();