Hey there! any question in your mind? Ask It Now!.

Popular Categories





how to generate csv file and send as attachment in cakephp

0 votes
386 views
asked in Programming by anonymous
how to generate csv file and send as attachment in cakephp

1 Answer

0 votes
answered by Bhartesh (2,730 points)
edited by Bhartesh

To generate csv file you can check this question (Already answered) : 

How to generate CSV file in cake php?

And to send it on attachment this code can help you, pls check :
 
$email = new PHPMailer(); 
$email->From = 'you@example.com'; 
$email->FromName = 'Your Name';
 $email->Subject = 'Message Subject'; 
$email->Body = $bodytext;
 $email->AddAddress( 'destinationaddress@example.com' ); 
$file_to_attach = 'PATH_OF_YOUR_FILE_HERE';
 $email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' ); 
return $email->Send();

Related Questions

+6 votes
2 answers 1,507 views
+5 votes
1 answer 1,167 views
0 votes
1 answer 241 views
+6 votes
3 answers 6,825 views
+2 votes
1 answer 136 views
+4 votes
5 answers 713 views
0 votes
1 answer 9,829 views
+2 votes
3 answers 280 views
asked in Programming by jatin Expert (3,823 points)
+2 votes
1 answer 141 views

Not a Member yet?

Ask to Folks Login

My Account
617 Folks are online
62 members and 555 guest online
Your feedback is highly appreciated