Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP mail() Test Mode?

Status
Not open for further replies.

cmayo

MIS
Apr 23, 2001
159
US
I'm beginning a newsletter/mass-mailing project and naturally don't want to send a zillion test mails while I'm building this thing. Does anyone know if there's a way to put PHP's mail() command into a test mode so I can have my scripts execute through the actual mailing commands, but have the mails go to /dev/null or some other bottomless pit?

I see in the docs that I can deliver sendmail parameters with PHP's mail(), and I see that sendmail has a -bt switch for testing addresses and a -bv mode for verifying names but it looks like those modes, even if they prevent mails from actually being sent (do they?), are going to be doing some extra processing and generate some extra output, and I'd like to run in a test mode that gave me a pretty representative idea how quickly things will process when not testing.

In other words, if sending ten real mails takes three seconds, it'd be great if I had a test mode that also took three seconds to test-send ten mails.

Thanks in advance,
 
why not just throw in a "test mode" line to set the TO: field for all mail to your email address?

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
That'd work, but I'd like to test execution time against at least a couple thousand records and don't know that I want to deal with that many mails at any of my email addresses.
 
... hotmail and many others are free... make an account for testing and throw it away later

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top