DamianTV Posted May 11, 2011 Share Posted May 11, 2011 Hopefully there is a simple solution to this. I have a form that when submitted sends a message to an email address from the form. A customer fills it out, so there is no single one email address. However, half of the time, the retards that use this form dont know their own email address and dont bother to put the .net at the end of it. or they misspell it. The other half of the time they dont even bother to put the @ and the domain. They still think this is AOL for some god unknown reason. And I cant account for all the ways that they can not figure out how to fuck up their email address, so an email-validator doesnt work because they can even beat that and still manage to break it. For example, one guy named Mike continues to put the first half of his email in as Miek or Mik or just spelled completely wrong, and the 550 error that comes up when he puts that garbage in, which is most of the time (I think the guy is blind or something) is because his email address doesnt exist on the mail server because he cant spell it right, when on the off chance he actually does get the @domain.com in the end. I really hate my retard customers. So my simple little form blows up on them. But what I am trying to do is to have something like this if(@mail(args)) { //success, I'll call them back shortly } else { //youre a retard, please put in your email address correctly } However, the error handling isnt working. mail() is supposed to return FALSE if it encounters an error, an error that I'd rather put in an error log and not display to the customer, however, the error suppressor doesnt work. Any Suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/236091-error-handling-for-mail-on-a-windows-box/ Share on other sites More sharing options...
freelance84 Posted May 11, 2011 Share Posted May 11, 2011 hahahahaha.... im not sure exactly what you're after. But here is an email validating php i found and use: if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { //youre a retard, please put in your email address correctly (i dont put this bit in) } else{ //you are not a retard... (i also dont put this bit in) } Or have they already registered with you, then dont you just want to check the sent email against one saved in a db? You can also use a similar JS function to check their email before they send the email. Quote Link to comment https://forums.phpfreaks.com/topic/236091-error-handling-for-mail-on-a-windows-box/#findComment-1213744 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.