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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.