xoxacika
xoxacika

Reputation: 3

Send email with special(generated) link for sending confirmation email

I want to use html form for submitting some data/info as email to specific(one) recipient with specific/unique generated link, so when the recipient get the email with the info and generated link, he could click the link and confirm this information by sending another email(email address filled in the html form) with some confirmation text.

So in short:

Form submit --> request email sent to the recipient with generated confirmation link --> if confirmation link is clicked, then send email to address from the Form submit.

Basically I know how to make a proper html form and send the email to specific recipient, but I don't how to generate a link(would this be enough: $generatedKey = sha1(mt_rand(10000,99999).time().$email);?), and how to send email to the address from HTML form when confirmation is approved?

Now, I've being thinking about this, and I came up with the following scenario, but I don't understand how to transfer the sender email(the one that filled in the HTML form):

Confirmation linked clicked --> landing on the page and request authorization --> proceed to inner PHP script with auto sending email to the email address from HTML form(how do I get it?!).

Upvotes: 0

Views: 280

Answers (1)

Martin
Martin

Reputation: 22760

This is longer than a comment so I set as an answer summarising our extensive comments below the question.

Due to the OP stating they wont be using Databases to track data then it seems fairly impractical [for me] to provide a solution that doesn't use databases. There are other methods (filesystem / cookies / sessions) but these suffer significant shortcomings such as security, reliability and/or practicality.

Recommended reading:

Upvotes: 2

Related Questions