# \[php\] Validating email (too Picky)

**URL:** <https://forum.kirupa.com/t/php-validating-email-too-picky/236695>\
**Category:** programming\
**Created:** [August 22, 2007, 10:35pm UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695 "2007-08-22T22:35:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingofnukes](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kingofnukes](https://forum.kirupa.com/u/kingofnukes)\
**Post date:** [August 22, 2007, 10:35pm UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695/1 "2007-08-22T22:35:31Z")

</div>

Ok, I need to keep my site bot free, one way I’m keeping them out is with email validation. I currently found a script and it works good, but is very strict. Email services such as msn, hotmail, and aim through out rejections even if the email IS valid. he only ones I can properly validate is yahoo and gmail. Even my own personal site email rejects validation.

Doesn anyone have some better validation scripts?

---

<div class="post-metadata">

**Author:** ![JohnHansenArtist](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/johnhansenartist/32/8958_2.png) [@JohnHansenArtist](https://forum.kirupa.com/u/JohnHansenArtist)\
**Post date:** [January 24, 2018, 9:01pm UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695/3 "2018-01-24T21:01:45Z")

</div>

HTML5 has a very good starting point for verification. Also use “required” in your fields. You can then build your own javascript rules for validation if(false){deal with error}. This will handle client side before you submit the email form. Your php file that handles submit can then further validate the formdata, [php.net](http://php.net) has great info, and you can also implement [PHPMailer](https://github.com/PHPMailer/PHPMailer) which is quite easy to set up.

You may also want to check the settings within your webhosting mail server as SPF and DKIM authentication may not be set up properly. They will need to fix this for you if needed.

Hope that helps,  
John

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [January 25, 2018, 7:11am UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695/4 "2018-01-25T07:11:45Z")

</div>

John - you are about 10 years too late with your response 😛

---

<div class="post-metadata">

**Author:** ![JohnHansenArtist](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/johnhansenartist/32/8958_2.png) [@JohnHansenArtist](https://forum.kirupa.com/u/JohnHansenArtist)\
**Post date:** [January 25, 2018, 2:43pm UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695/5 "2018-01-25T14:43:17Z")

</div>

LOL Too funny!

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [January 25, 2018, 3:25pm UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695/6 "2018-01-25T15:25:36Z")

</div>

Maybe the question was 10 years too early 🤔

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [January 29, 2018, 2:47am UTC](https://forum.kirupa.com/t/php-validating-email-too-picky/236695/7 "2018-01-29T02:47:09Z")

</div>

Didn’t @Jeff_Wheeler write an RFC-conforming regexp for this about 10 years ago?
