FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to NOT send empty files via email?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
How to NOT send empty files via email? [message #178824] Thu, 09 August 2012 15:19 Go to previous message
Paul is currently offline  Paul
Messages: 3
Registered: February 2012
Karma:
Junior Member
Hi,
I have a simple php page that grabs a .txt file if it exists and emails it.

I would like to modify it so that if the file is under 60 bytes, dont send it.

Here is what I am doing to send the file:
$messageBody .=file_get_contents("d:\notes\note $filedate.txt");
$messageBody .= "\n\r==============================================================\n\r";
$messageBody .=file_get_contents("d:\notes\middaynote $filedate.txt");


ini_set("SMTP", "mailserver");
ini_set("smtp_port", "25");
$headers = "From: reports(at)company(dot)com";


mail("myreport(at)company(dot)com","Here are your reports $today",$messageBody,$headers);

thanks for any help
[Message index]
 
Read Message
Read Message
Previous Topic: How to make Apache to allow an executable to leave a file?
Next Topic: How to make Apache to allow an executable to leave a file?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 04:49:03 GMT 2024

Total time taken to generate the page: 0.03935 seconds