Write a function to validate email address

  • Tila: Closed
  • Palkinto: $10
  • Vastaanotetut työt: 1
  • Voittaja: ActazenCorp

Kilpailun tehtävänanto

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.....

Suositellut taidot

Työnantajan palaute

“Made the function as needed. Good work.”

Profiilikuva vknrvk, India.

Julkinen selvennystaulu

  • abid861
    abid861
    • 11 vuotta sitten

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

    • 11 vuotta sitten
    1. vknrvk
      Kilpailun järjestäjä
      • 11 vuotta sitten

      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.

      • 11 vuotta sitten
    2. abid861
      abid861
      • 11 vuotta sitten

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

      • 11 vuotta sitten
  • Abdulaziz01
    Abdulaziz01
    • 11 vuotta sitten

    what is wrong with entry #10 ?

    • 11 vuotta sitten
    1. Abdulaziz01
      Abdulaziz01
      • 11 vuotta sitten

      it checks if the domain is valid

      • 11 vuotta sitten
    2. vknrvk
      Kilpailun järjestäjä
      • 11 vuotta sitten

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

      • 11 vuotta sitten
  • vknrvk
    Kilpailun järjestäjä
    • 11 vuotta sitten

    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.

    • 11 vuotta sitten
  • vknrvk
    Kilpailun järjestäjä
    • 11 vuotta sitten

    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.

    • 11 vuotta sitten
  • vknrvk
    Kilpailun järjestäjä
    • 11 vuotta sitten

    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.

    • 11 vuotta sitten
  • eggyal
    eggyal
    • 11 vuotta sitten

    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?

    • 11 vuotta sitten
  • marcsmith77
    marcsmith77
    • 11 vuotta sitten

    b) and c) are more or less impossible.

    • 11 vuotta sitten
    1. abid861
      abid861
      • 11 vuotta sitten

      very much possible!

      • 11 vuotta sitten
  • vknrvk
    Kilpailun järjestäjä
    • 11 vuotta sitten

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

    • 11 vuotta sitten
  • vknrvk
    Kilpailun järjestäjä
    • 11 vuotta sitten

    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.

    • 11 vuotta sitten
  • GeorgeMiles9
    GeorgeMiles9
    • 11 vuotta sitten

    This is not possible my friend

    • 11 vuotta sitten

Näytä lisää kommentteja

Kuinka päästä alkuun kilpailuiden kanssa

  • Ilmoita kilpailusi

    Ilmoita kilpailusi Nopeaa ja helppoa

  • Saat valtavasti töitä

    Vastaanota tonnikaupalla osallistumisia Ympäri maailmaa

  • Myönnä palkinto parhaalle työlle

    Myönnä palkinto parhaalle työlle Lataa tiedostot - Helppoa!

Ilmoita kilpailu nyt tai liity tänään!