Forum Moderators: coopster
I am trying to design an email system in my site. Its more like members to members email system.
When a member sends an email, the email content is stored into the database and an email notification email is sent to the recipient to let him know that, he has received an email in my site.
I am able to save the email content into database but what i am not able to understand is, how to create an unique id for each email. So that when the email notification is sent, i can create an unique url for that email. Which when clicked should take the member to their mailbox with this message in view mode.
Initially, i thought, i will have an auto generated serial number in my mysql database. Then I will create MD5 on this and insert into URL but now i feel if i have to do this, first i will have to insert the data and then use mysql command to fetch the top most record of any particular emailID, then get the serial number and then create MD5.
Is there any other way out?
Thank you,
e.g
$msg_hash = md5(date());
$q = @mysql_query("INSERT INTO message(content,hash) VALUES($content, $msg_hash)");
$msg = "You have a new message at mysite. go to www.mysite.com?m=$msg_hash to read it";
mail($to, $from...etc.)