ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Removing unconfirmed members --> Part 4

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
162 active users
3160 visitors today
4723 pages today
how is this done?
ASP.NET Showcase
ASP.NET Graph and Chart Component with FREE developer version

ASP.NET Shopping Cart and E-commerce Control with FREE trial download

ASP.NET Web Hosting with free month and setup

$15 Domain Name Registration from .DNR.
As seen on these sites
Special thanks go to the sites that support me by publishing my articles.
See more

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
ASPRSS
ShawThing

Now open source with SourceForge!

Emailing a reminder

I wanted to email the prospective member, and give the option in the email to quickly confirm his membership, so I used the same code as in the original sign up page to include the link to C.asp.

(Of course, it's possible that I should have moved this "duplicate code" into an SSI, but I judged that the duplication was minimal)

if ( dDate.getDate ( ) == nDate )
{
   var sEmail = '' + oRecordSet ( 1 );
   var sName = '' + oRecordSet ( 2 );
   var sDate = FormatDateDMY ( dDate );

   // send Email with our generic function
   var sBody = 'Dear ' + sName + '\n\n';

   sBody += 'Today is your last chance to confirm your membership on CoverYourASP.com!\n\n';
   sBody += 'Membership accounts have to be confirmed via email - and unconfirmed accounts are only kept for 10 days. Since you registered on ' + sDate + ' your membership account will be deleted tomorrow unless you confirm your account.\n\n';
   sBody += 'To confirm your CoverYourASP membership account please click on the link below, or copy and paste the entire URL into your  browser.\n\n';
   sBody += 'IMPORTANT: if the link below is wrapped onto two lines by your email software please copy from the "http" to the end of the number on the second line, then paste that into your browser.\n\n';
   sBody += 'http://CoverYourASP.com/C.asp?a=a&e=' + sEmail + '&i=' + nID + '\n\n';
   sBody += 'I hope to hear back from you soon!\n\n';
   sBody += 'Member Services\n';
   sBody += 'MemberServices@CoverYourASP.com\n';
   sBody += 'http://CoverYourASP.com/';

   if ( -1 == sServer.indexOf ( 'localhost' ) )
      SendEmail ( 'MemberServices@' + sHostDomain, sEmail, '', 'Final Notice: Lapsing CoverYourASP membership', sBody );
}

Fairly straight-forward code I hope you'll agree. Get the email and name of the member from the recordset, then make up the body of the email in the sBody variable.

Two things to note:
• The use of \n as a linefeed in JavaScript.
• How I don't send the email if running from localhost, i.e. my development machine! The sServer variable is set globally in Init( ), and contains the value of Request.ServerVariables ( 'SERVER_NAME' ).

Part 5: Deleting unconfirmed members...

Featured sponsor
My favorite resources

Selling products online - read how James does it now



See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!


Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!