Write a function to validate email address

  • Status: Closed
  • Preis: $10
  • Einträge eingereicht: 1
  • Gewinner: ActazenCorp

Kurzbeschreibung des Wettbewerbs

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

Empfohlene Fähigkeiten

Feedback vom Arbeitgeber

“Made the function as needed. Good work.”

Profilbild vknrvk, India.

Öffentliche Anschlagtafel

  • abid861
    abid861
    • 10 Jahre zuvor

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

    • 10 Jahre zuvor
    1. vknrvk
      Wettbewerbs-Inhaber
      • 10 Jahre zuvor

      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 Jahre zuvor
    2. abid861
      abid861
      • 10 Jahre zuvor

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

      • 10 Jahre zuvor
  • Abdulaziz01
    Abdulaziz01
    • 10 Jahre zuvor

    what is wrong with entry #10 ?

    • 10 Jahre zuvor
    1. Abdulaziz01
      Abdulaziz01
      • 10 Jahre zuvor

      it checks if the domain is valid

      • 10 Jahre zuvor
    2. vknrvk
      Wettbewerbs-Inhaber
      • 10 Jahre zuvor

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

      • 10 Jahre zuvor
  • vknrvk
    Wettbewerbs-Inhaber
    • 10 Jahre zuvor

    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 Jahre zuvor
  • vknrvk
    Wettbewerbs-Inhaber
    • 10 Jahre zuvor

    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 Jahre zuvor
  • vknrvk
    Wettbewerbs-Inhaber
    • 10 Jahre zuvor

    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 Jahre zuvor
  • eggyal
    eggyal
    • 10 Jahre zuvor

    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 Jahre zuvor
  • marcsmith77
    marcsmith77
    • 10 Jahre zuvor

    b) and c) are more or less impossible.

    • 10 Jahre zuvor
    1. abid861
      abid861
      • 10 Jahre zuvor

      very much possible!

      • 10 Jahre zuvor
  • vknrvk
    Wettbewerbs-Inhaber
    • 10 Jahre zuvor

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

    • 10 Jahre zuvor
  • vknrvk
    Wettbewerbs-Inhaber
    • 10 Jahre zuvor

    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 Jahre zuvor
  • GeorgeMiles9
    GeorgeMiles9
    • 10 Jahre zuvor

    This is not possible my friend

    • 10 Jahre zuvor

Mehr Kommentare zeigen

Einstieg in Wettbewerbe

  • Veröffentlichen Sie Ihren Wettbewerb

    Veröffentlichen Sie Ihren Wettbewerb Schnell und einfach

  • Erhalten Sie zahlreiche Einträge

    Erhalten Sie zahlreiche Einträge aus der ganzen Welt

  • Vergeben Sie die Prämie an den besten Eintrag

    Vergeben Sie die Prämie an den besten Eintrag Laden Sie die Dateien herunter - ganz einfach!

Wettbewerb Veröffentlichen oder registrieren Sie sich heute!