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 Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/173429-solved-email-from-handle/#findComment-914552 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.