Jump to content

Error Handling for mail() on a Windows Box


DamianTV

Recommended Posts

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?

Link to comment
Share on other sites

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.

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.