0
PHPMailerクラスを使用したattachment.iで電子メールを送信する関数を作成しました。 電子メールは送信されますが、添付ファイルが取得されません。無意味な流暢なインターフェイスの報酬を収獲私の電子メールにPdfが添付されていません
私のコントローラコード
public function send_mail()
{
$this->load->library('email');
$subject = 'Request For Quotation';
$message = '<p>This message has been sent for testing purposes.</p>';
// Get full html:
$body =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset='.strtolower(config_item('charset')).'" />
<title>'.html_escape($subject).'</title>
<style type="text/css">
body {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 16px;
}
</style>
</head>
<body>
'.$message.'
</body>
//</html>';
$this->load->library('M_pdf');
$this->m_pdf->pdf->setTitle('Request for Quotation');
$html = 'hiiiiiiiiiiiiiiiiiiiiiiiiiiiiii';
$this->m_pdf->pdf->WriteHTML($html);
$content=$this->m_pdf->pdf->Output('RFQ.pdf',"S");
$result = $this->email->from('[email protected]')->to('[email protected]')->subject($subject)->message($body)->attach($content, '', 'base64', '')->send();
var_dump($result); // echo '<br />'; echo $this->email->print_debugger(); exit;
}
。例外処理を追加したり、戻り値をチェックしたりしてください。 – Synchro
私を助けることができます、私はたくさん試しましたが、得られません。 – user6413618
あなたは[codeigniter docs](http://www.codeigniter.com/user_guide/libraries/email.html)を読む必要があります。 – Synchro