To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Coding

Coding Help with PHP coding

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 05-14-2006, 12:30 PM   #1
essexboyracer
Member
 
Join Date: Jun 2001
Location: UK
Posts: 51
[RESOLVED] PHPMailer & Attachments

Hi All,

I am using PHPMailer to send out emails (one at a time, as and when type thing) in SMTP mode. The emails have a dynamic PDF attached which I dont want to keep after sending, therefore remove from the server.

Once PHPMailer has been started, do I need to wait before deleting the file? as in the example code below

Code:
// After email with PDF is mailed, need to remove the certificate from the server

sleep(4); // Delay for 4 seconds
unlink("/home/username/public_html/certificates/".$filename); // remove the PDF

// Alternative, set a cron job to unlink all certs that have a timestamp 2 hours old

Last edited by essexboyracer; 05-14-2006 at 01:06 PM.
essexboyracer is offline   Reply With Quote
Old 05-15-2006, 03:05 AM   #2
bogu
I code 4 beer ...
 
bogu's Avatar
 
Join Date: Nov 2002
Location: Romania
Posts: 1,743
When u send mass mails is always better to delay a few seconds between mails...
__________________
/**
* The answer is so obvious, duh!
* It's like, whatever ...
*
* If your problem has been solved, PLEASE click the RESOLVED LINK under "Thread Tools"
*/
bogu is offline   Reply With Quote
Old 05-23-2006, 01:44 PM   #3
essexboyracer
Member
 
Join Date: Jun 2001
Location: UK
Posts: 51
I think i am going to set up a cron job and calculate the time diff of about 1/2 hour before deleting, I have no idea what SMTP expects in terms of queueing a mail, so just to be safe!

I wonder if I need to sleep at all, and if the mail gets submited to SMTP with attachment immediately for queuing, or does SMTP link to the attachment whilst in the queue?
essexboyracer is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:40 AM.








Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.