Write a function to validate email address

  • Status: Closed
  • Prize: $10
  • Entries Received: 1
  • Winner: ActazenCorp

Contest Brief

Hello,

I am looking for a function to validate email address in following ways

a) It should check syntactically a valid email address.
b) Validate the domain is a valid one and can receive emails for that domain.
c) Validate the email address exists.

This should be done using SMTP gateway access which require username and password to access the gateway.

It should generate error codes as follows:

wrong_email_address - Which represent syntactically wrong email addresses
wrong_domain. - Which denotes the wrong domain
invalid_address -Email address doesn't exist.

All codes should be properly and thoroughly commented.

This is to be done in PHP. The email address and message should be inserted into a table in mysql DB

Table emails (
email_id varchar(255),
msg varchar(255)
);

Before inserting the email address into the table, check if it is already in the table. If yes, just update latest message. Otherwise insert the new record.

And,, AHAH.... No existing or already available general functions please...

Happy coding.....

Recommended Skills

Employer Feedback

“Made the function as needed. Good work.”

Profile image vknrvk, India.

Public Clarification Board

  • abid861
    abid861
    • 10 years ago

    Its very doable. But don't you think 10$ a little to less for such a contest/task?

    • 10 years ago
    1. vknrvk
      Contest Holder
      • 10 years ago

      Wanted to see a contest functioning and get a clean code. That was the idea. I have bits and pieces of code addressing these issues. I could make it into a class. However, I thought there could be very good coder who can address this and make clean and concise code. Once the contest is over, if I don't get good code for the function/class, I will include my code here for all to see and use, if needed.

      • 10 years ago
    2. abid861
      abid861
      • 10 years ago

      I see.. thanks for the detail :) .. *thumbs up*

      • 10 years ago
  • Abdulaziz01
    Abdulaziz01
    • 10 years ago

    what is wrong with entry #10 ?

    • 10 years ago
    1. Abdulaziz01
      Abdulaziz01
      • 10 years ago

      it checks if the domain is valid

      • 10 years ago
    2. vknrvk
      Contest Holder
      • 10 years ago

      That is correct. It checks the domain. But id doesn't check if the email address really exist.

      • 10 years ago
  • vknrvk
    Contest Holder
    • 10 years ago

    All entries handles either step 1 and 2. None check for all steps. Hence all entries received till now are rejected.Some have addressed the syntax check (step 1), some addressed the domain check (step 2). However none addressed the checking if the email address really exist.

    • 10 years ago
  • vknrvk
    Contest Holder
    • 10 years ago

    If the syntax is correct, but the domain is wrong, then no need to check for validity of email address. Validity check calls for interaction with SMTP server.

    • 10 years ago
  • vknrvk
    Contest Holder
    • 10 years ago

    THis is to avoid detailed step as first source. If the syntax is wrong, no need to go further and check others which will call for network checking.

    • 10 years ago
  • eggyal
    eggyal
    • 10 years ago

    Why bother doing steps (1) and (2)? If step (3) is successful, it would imply that steps (1) and (2) would have been successful had they been attempted. Or is it actually important to understand at which step a particular address fails?

    • 10 years ago
  • marcsmith77
    marcsmith77
    • 10 years ago

    b) and c) are more or less impossible.

    • 10 years ago
    1. abid861
      abid861
      • 10 years ago

      very much possible!

      • 10 years ago
  • vknrvk
    Contest Holder
    • 10 years ago

    I got some idea about this. Looking for a neat and concise code as a function or class.

    • 10 years ago
  • vknrvk
    Contest Holder
    • 10 years ago

    OK. I saw the code to validate the correctness of email address and the domain. Hence, it is possible to do it. However it was a patchy work. Want a very tidy Single function for these.

    • 10 years ago
  • GeorgeMiles9
    GeorgeMiles9
    • 10 years ago

    This is not possible my friend

    • 10 years ago

Show more comments

How to get started with contests

  • Post your contest

    Post Your Contest Quick and easy

  • Get tons of entries

    Get Tons of Entries From around the world

  • Award the best entry

    Award the best entry Download the files - Easy!

Post a Contest Now or Join us Today!