Welcome Guest, Not a member yet? Register   Sign In
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('[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
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.




Theme © iAndrew 2016 - Forum software by © MyBB