Send email to customer to check if there is or not

Asked

Viewed 401 times

2

I made a registration to be entered the Cpf and email, the Cpf I was able to validate straight, to see if it works or not. But when the part comes to know if the email exists...I searched a lot and saw a way, which is to send an email to the user, and if the email is sent, ie not back, it exists. But I have no idea how to do it, someone can give me a light?

  • Consider using a service that checks your email, for example: https://github.com/overint/php-mailgun-validation

  • tried PHPMAILER ?

1 answer

6


To check if an email exists, it is necessary to create an extra step in your registration. When you register, register your status as "pending" or something like that, and send a confirmation email to the given address. The email must contain a unique link from that user, such as a hash of the informed email + some arbitrary value such as salt.

When the user accesses the link (which points to your system), you check the hash passed, and update the status to "registered".

  • helped you @Nazarelisboa ?

  • @Why is it no use simply knowing if the e-mail was sent and received, you need to make sure that the address is correct and the user who made the registration has access to this account... otherwise you do not guarantee that he will receive your messages through this channel in the future. If that’s not important, you don’t have to worry about that validation.

  • This is of utmost importance @Leandroangelo

  • He explained a lot to me. But I wanted to ask a question: do I need to create a server only for users' emails? a friend of mine said I need it, but I don’t think it would be for that @Juliohenrique97

  • @Nazarelisboa generally does not, it depends on the volume of data you will be working on.

  • instead of https://www.sitedanazarelisboa.com.br is localhost:8080/site/index.php For example

  • in case I can put like this: localhost:8080/site/ ?

  • I put it and it worked, only it gives the following error: Error in sending the connect() e-mailSMTP failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.