简体   繁体   中英

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?!).

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM