Guardian-Mage Posted June 29, 2008 Share Posted June 29, 2008 I am using a custom mass-emailing solution which uses PHPmailer to compose my HTML messages. I have a cron job set up to run the script every 6 minutes, and my script sends 40 emails everytime it is run. However, I am testing it by manually running it, and only sending 4 emails and it takes 20-30 seconds to run. I used set_time_limit(340); at the top of my script and at the bottom after the emails are send i use set_time_limit(20);. This is because my MySQL connection was timing out/cutting off. Still, do you know how to reduce the time it takes? I don't want my mass email to timeout when it matters. Link to comment https://forums.phpfreaks.com/topic/112437-solved-php-mail-timeout/ Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 I had a similar problem with a publishing system I wrote once. The script wouldn't time out but the MySQL connection would. Although there is a way to change your MySQL timeout connection, I found that it never actually worked for me. In the end I had to a kind of incremental publish where it would publish a small portion and then reconnect and publish another small portion. This would repeat untill the whole thing was published. Maybe this could work for you? Link to comment https://forums.phpfreaks.com/topic/112437-solved-php-mail-timeout/#findComment-577227 Share on other sites More sharing options...
Guardian-Mage Posted June 29, 2008 Author Share Posted June 29, 2008 I fixed the MySQL problem. After the emails are sent, I disconnect from MySQL, than reconnect and insert the confirmation into the database. So you don't think I need to worry about timeouts? Link to comment https://forums.phpfreaks.com/topic/112437-solved-php-mail-timeout/#findComment-577229 Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 No, you pretty much did what I said. I imagine each time you reconnect to MySQL the timeout count resets. I would try it but I think it should be ok now. Happy spamming! lol If this is solved could you set it as 'Topic Solved' please? Link to comment https://forums.phpfreaks.com/topic/112437-solved-php-mail-timeout/#findComment-577232 Share on other sites More sharing options...
Guardian-Mage Posted June 29, 2008 Author Share Posted June 29, 2008 Not spamming It is for a client that sends out a newsletter every month. And yes I will mark as solved Link to comment https://forums.phpfreaks.com/topic/112437-solved-php-mail-timeout/#findComment-577247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.