• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email Class Not Working

Hi All,

I am having issues when sending mail through Email Class, below is the code i am using. Mail is going if attach() is not used. If attach() is used then it is going to failure case

function create()
$date = date('d-m-y');

pdf_create( $this->load->view( 'html.php', '', true ), $date );

$this->email->from('[email protected]', 'Website');
$this->email->to('[email protected]');

$this->email->subject('Today Report');
$this->email->message('Please check your daily report for today');
$this->email->attach("/home/website/CI/pdf/todayreport.pdf");  // this url is fine because i am uploading through this path and works fine and pdf is also there in that pdf folder

echo "it is working fine";


echo "failure";



Can anyone tell me if i am doing anything wrong. My attachments are only PDF files. Attach() is giving me error.

The CodeIgniter Class I guess is incomplete.

I used PHPMailer class for email.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.