0
attachment.i를 사용하여 이메일을 보내는 기능을 PHPMailer 클래스에 작성했습니다. 이메일을 보내지 만 첨부 파일이 전송되지 않습니다.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