Jump to content

File Writing & Email Sending in PHP


atchua

Recommended Posts

i already have a script that can be divided into 2 parts:

(a) retrieves records from the database then writes the retrieved records onto an excel file;
(b) once the file has been created and populated with data, it will be sent as an attachment in an email

with that scenario, i always receive an incomplete file.  In some forums, they say that the email sending process might have sent the email even before the file writing is not yet finished.  i have already inserted a delay between the two process/parts of 30 minutes but it produces the same thing. although without the delay of 30 minutes, the records lack around 70-90+ records while when the delay is inserted only around 10+ records is lacking in the attached file.

i just want to ask why is this so? is there any other way to ensure that the file writing part is finished first before it can proceed to the code section where it sends out the email with the excel file created as an attachment.

thanks
Link to comment
https://forums.phpfreaks.com/topic/27846-file-writing-email-sending-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.