Write a function to validate email address

  • Status: Closed
  • Hadiah: $10
  • Penyertaan Diterima: 1
  • Pemenang: ActazenCorp

Ringkasan Peraduan

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

Kemahiran Disyorkan

Maklum Balas Majikan

“Made the function as needed. Good work.”

Gambar Profil vknrvk, India.

Papan Penjelasan Umum

  • abid861
    abid861
    • 11 tahun yang lalu

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

    • 11 tahun yang lalu
    1. vknrvk
      Penganjur Peraduan
      • 11 tahun yang lalu

      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 tahun yang lalu
    2. abid861
      abid861
      • 11 tahun yang lalu

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

      • 11 tahun yang lalu
  • Abdulaziz01
    Abdulaziz01
    • 11 tahun yang lalu

    what is wrong with entry #10 ?

    • 11 tahun yang lalu
    1. Abdulaziz01
      Abdulaziz01
      • 11 tahun yang lalu

      it checks if the domain is valid

      • 11 tahun yang lalu
    2. vknrvk
      Penganjur Peraduan
      • 11 tahun yang lalu

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

      • 11 tahun yang lalu
  • vknrvk
    Penganjur Peraduan
    • 11 tahun yang lalu

    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 tahun yang lalu
  • vknrvk
    Penganjur Peraduan
    • 11 tahun yang lalu

    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 tahun yang lalu
  • vknrvk
    Penganjur Peraduan
    • 11 tahun yang lalu

    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 tahun yang lalu
  • eggyal
    eggyal
    • 11 tahun yang lalu

    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 tahun yang lalu
  • marcsmith77
    marcsmith77
    • 11 tahun yang lalu

    b) and c) are more or less impossible.

    • 11 tahun yang lalu
    1. abid861
      abid861
      • 11 tahun yang lalu

      very much possible!

      • 11 tahun yang lalu
  • vknrvk
    Penganjur Peraduan
    • 11 tahun yang lalu

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

    • 11 tahun yang lalu
  • vknrvk
    Penganjur Peraduan
    • 11 tahun yang lalu

    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 tahun yang lalu
  • GeorgeMiles9
    GeorgeMiles9
    • 11 tahun yang lalu

    This is not possible my friend

    • 11 tahun yang lalu

Tunjukkan lebih banyak komen

Bagaimana untuk mulakan dengan peraduan

  • Siarkan peraduan anda

    Siarkan Peraduan Anda Cepat dan mudah

  • Dapatkan berjuta penyertaan

    Dapatkan Bertan-tan Penyertaan Dari serata dunia

  • Anugerahkan penyertaan terbaik

    Anugerahkan penyertaan terbaik Muat turun fail - Mudah!

Siarkan Peraduan Sekarang atau Sertai kami Hari Ini!