Current location: Hot Scripts Forums » Programming Languages » PHP » Sending an activation e-mail


Sending an activation e-mail

Reply
  #1 (permalink)  
Old 03-30-04, 02:35 PM
dcooldude_1's Avatar
dcooldude_1 dcooldude_1 is offline
Newbie Coder
 
Join Date: Feb 2004
Location: Sidney
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Question Sending an activation e-mail

Hello,

I've come up with a stupid little way to create a unique activation key for every user that signs up with my system. Everything works nice, I have an activation form, that will take the key, compair it to the username and the assigned key, if it is valid, it will update my table so the user is active, inputs the date they activated.

What's even cooler, (keep in mind that I'm a begginer at this stuff), I made it so that if they try to login, they can't if the colum (or row, can't remember) with the username and status says that they are inactive..... (I think this is cool, because it only took me a few hours to figure this out.... And I'm a beginer. This stuff rocks!!!!)


Anyway, my question is this: How do I send that activation key to the user via e-mail? Everything works, except this part. Could someone please help me?
__________________
===================================
Dcooldude_1

Site 1: http://ih.sidneyps.com/hs/spokesman/
Site 2: http://www.webhex.net/

Go to http://www.chatzy.com/?132627185966 this is my chat area...
the password is: progtalk
===================================
Reply With Quote
  #2 (permalink)  
Old 03-30-04, 09:57 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hello,

Good job on your script! You know, eventually everyone will be a good programmer, but to be a better one, I think you need to have ideas (or flexibility or instinct, whatever you may call). Keep it up. =)

Assuming that your code allows a user to register, upon registering (i.e. after validation and database insertion), you can simply generate your activation key and send it by mail() to whoever's email address this user entered upon registeration.

At least, that's what I do. Good luck, then.
__________________
Blavv =|
Reply With Quote
  #3 (permalink)  
Old 03-31-04, 06:14 AM
simone's Avatar
simone simone is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
heres an example for you ...you add this right after the php which enteres the info into the database...

PHP Code:

mail("$THEIREMAIL""Activation Key!""Hey, thanks for signing up! please activate your account by clicking on the following link ... http://www.yoursite.com/userval.php?key=$THEIRKEY"); 

Of course change the variables accordingly. ... first part is their email, second the subject of the email and third the actual content..i like it like that because it doesnt have a reply email, and you dont get spammed, lol.

Last edited by simone; 03-31-04 at 06:16 AM.
Reply With Quote
  #4 (permalink)  
Old 03-31-04, 09:30 AM
dcooldude_1's Avatar
dcooldude_1 dcooldude_1 is offline
Newbie Coder
 
Join Date: Feb 2004
Location: Sidney
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

Thanx guys, your a REAL big help! I'll go try it out now.....
__________________
===================================
Dcooldude_1

Site 1: http://ih.sidneyps.com/hs/spokesman/
Site 2: http://www.webhex.net/

Go to http://www.chatzy.com/?132627185966 this is my chat area...
the password is: progtalk
===================================
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
From header in mail() <?Wille?> PHP 0 02-03-04 02:02 PM
Announcement: Mojo Mail is now Dada Mail skazat General HotScripts Site Discussion 0 12-07-03 10:10 PM
mail function causes server error thewhiteshadow PHP 1 11-13-03 03:40 PM
Mail Script sending multiple times when Table has a lot of data dsumpter PHP 12 07-16-03 05:17 PM
sending email acknowledgement to user after registration onlynils PHP 3 07-04-03 02:05 PM


All times are GMT -5. The time now is 10:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.