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

#1
[eluser]hema[/eluser]
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

Code:
function create()
{
    
$this->load->library('email');
$date = date('d-m-y');
$this->load->helper('to_pdf');

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

$this->email->from('abvvccd@gmail.com', 'Website');
$this->email->to('sssss@gmail.com');

$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
if($this->email->send())
{

echo "it is working fine";

}
else
{

echo "failure";

}


  
}

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

#2
[eluser]solid9[/eluser]
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-2020 MyBB Group.