SQL PHP HTML ASP JavaScript articles and free scripts to download
PHP PHP Scripts

Newsletter script by using PHP MySQL

Optin email list can be developed by asking users to subscribe to your newsletter. Here users have to add their email address to the list. To verify the ownership of the email address one confirmation email will be posted to subscribed email address of the user.

This script will have two parts.

Part 1 : Registering the user and verification of email address
Part 2 : Managing user and posting of newsletters.

Features of the Newsletter script

  1. Visitor will submit email address and script will check with existing list for matching email record.
  2. If the visitor is previously subscribed and verified email address then system will display message saying 'not required to subscribe again'
  3. If the visitor is previously subscribed and failed to verify email address then script will display message saying the same and give a link to resend the verification mail.
  4. If any unknown email address (previously not joined or confirmed ) try to confirm then system will not allow them
  5. Each verification email will have a link to visit for verification by user.
  6. Within 300 seconds ( can be adjusted ) user needs to confirm subscription by visiting the confirmation link.
Newsletter script process

Demo of subscribing to newsletter

You can test by submitting your email address and you will get confirmation mail in your inbox. Then by clicking the verification mail you can confirm subscription.

Subscribe to demo of this newsletter script

However this is demo only and not our newsletter box, so we will be deleting or sending you the delete link. Demo for Admin area is not available , however you can install and check at your end. Note that this is for your learning only and this is not to be used for any spamming or any other activity.

Displaying form to collect email address

One simple textbox with a button is to be provided for the user to enter their email address. Here the button will trigger one JavaScript function ajaxFunction() to carry the email address to another script file subscribeck.php by using Ajax.

Learn basics of Ajax and form submission here.

From subscribe.php page we will be sending two data , one is todo and other one is email to subscribeck.php page by POST method ( using Ajax ).

Confirming the email address

Confirmation email will have one link on the body of the email address. Once the user click the link or visit the URL. The script will read unique id , email and random number from the link and match the same with the record. The record will have date and time stored so the matching record will be checked within 24 hours of subscribing. If the record matches with the data provided by the user Link then the email address will be marked as confirmed or subscribed email address.

http://www.plus2net.com/newsletter/confirm.php?email_id=12&token=m0xyr7d9&tm=1404824477&confirm_id=7&email=userid@example.com

Unsubscribing to newsletter.

Posting of newsletters is discussed in Part II. At the bottom of each newsletter there will be one link for the user to click and visit a page at site to unsubscribe from the list. While unsubscribing we will bit liberal and only check for matching email address and unique id associated with the email address. One sample link for unsubscribing looks like this.

http://www.plus2net.com/newsletter/unsubscribe.php?email_id=12&email=userid@example.com&todo=delete

Posting Newsletter to subscribers.



Download zip file for this newsletter script

Be the first to post comment on this article :


Google+
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer