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
401 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,545 views
+5 votes
1 answer 1,168 views
0 votes
1 answer 246 views
+6 votes
3 answers 6,834 views
+2 votes
1 answer 138 views
+4 votes
5 answers 716 views
0 votes
1 answer 9,841 views
+2 votes
3 answers 281 views
asked in Programming by jatin Expert (3,823 points)
+2 votes
1 answer 143 views

Not a Member yet?

Ask to Folks Login

My Account
730 Folks are online
83 members and 647 guest online
Your feedback is highly appreciated