Bricktop Posted September 7, 2009 Share Posted September 7, 2009 Hi all, I have the following bit of code which writes a file to a particular folder based on the folder variable. I then attach that file to an email and have working code in place to do that. However, I don't think I'm doing it the best possible way, basically my code is: $handle = fopen($backupfolder.'/'.$subfolder.'/'.mktime().'-'.$file.'-backup.txt','w+'); $filename = ''.$backupfolder.'/'.$subfolder.'/'.mktime().'-'.$file.'-backup.txt'; sendfile($filename); I just wondered if I could achieve the above by just using the $handle variable or if there is any better/more efficient way of doing the above? Thanks Link to comment https://forums.phpfreaks.com/topic/173429-solved-email-from-handle/ Share on other sites More sharing options...
ignace Posted September 7, 2009 Share Posted September 7, 2009 http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php#attachment Link to comment https://forums.phpfreaks.com/topic/173429-solved-email-from-handle/#findComment-914301 Share on other sites More sharing options...
Bricktop Posted September 8, 2009 Author Share Posted September 8, 2009 Thanks ignace, I'll take a look. Link to comment https://forums.phpfreaks.com/topic/173429-solved-email-from-handle/#findComment-914552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.