Jump to content

automated emails


robcrozier

Recommended Posts

hi everyone,

Here’s the problem im trying to solve.  I want to allow users to register their email addresses on a site in order to receive a monthly newsletter.  However to avoid spam I want to initially send an automated email to the address they registered with which will include a link which they can click on to verify that it was actually them.  When the link is clicked in the email I then want that persons email address to be stored in the database.

Can anyone give me a clue?

Cheers
Link to comment
Share on other sites

In the table containing the emails, have a field called is_activated with this type: ENUM('0','1')
and a field called activation code with something like this type: VARCHAR(50)

When they add their email and you add it to the database set is_activated to 0 and make a random activation code like [code]uniqid(md5($email.microtime());[code] Then send them a mail containg a link like this: http://example.com/activate.php?activation_code=**the activation code here**&email=**the email here**
on the activate page you should check if the email matches the activation code, and if it does, then set is_activated to 1.

When sending mails, only send it to email where is_activated is set to 1.[/code][/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.