School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,130 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,020 people online right now. Registration is fast and FREE... Join Now!




Auto email generated serial after user submits info

 

Auto email generated serial after user submits info, I'm looking for an auto email application to email generated seria

flyinkool

4 May, 2009 - 11:41 AM
Post #1

New D.I.C Head
*

Joined: 4 May, 2009
Posts: 1

I am looking for some sort of content management system that can do the following:

1. User submits info and is taken to Demo download site
2. An email is automatically generated including a serial number (from our code or a list, either would be fine) and sent to the user
3. The user info (submitted in step 1) is stored along with the serial number they were sent automatically in some database.

I've looked all over for an already developed application that would do this. I can't even find info on how to do this myself (I am a very novice programmer).

Thanks,

User is offlineProfile CardPM
+Quote Post


Martyr2

RE: Auto Email Generated Serial After User Submits Info

4 May, 2009 - 07:07 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 7,307



Thanked: 838 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
This is not terribly hard to do. You create a simple form that collects the user's info. You have it then submit the info where it runs a check to make sure everything is correct. If all tests pass, you can generate a serial based on whatever algorithm or scheme you want. After it is generated (using a function) the value and the info submitted are simply inserted into a database.

If the insert was successful, you create an email on the system and send it to the user.

How you do this all depends on the language you are using and the software you are running, but I assure you the whole process can be achieved in a relatively simply program/script.

CODE

<?php

// User submitted info being collected
$name = $_POST["name"];
$email = $_POST["email"];

// We generate a serial based of php uniqid function
$serial = uniqid();

// Insert into database with name, email and the new generated serial
$success = mysql_query("insert into users (name, email, serial) values('$name','$email','$serial')");

// If successfully inserted, create email and send to user
if ($success) {
   $body = "Thanks $name, your serial is $serial";
   mail($email,"Thanks for signing up",$body);
}
else {
   die("Houston, we have a problem!");
}


Here I am using PHP but the process is going to be similar in other languages. Collect the form info, generate your serial, insert into database and if all that is correct, email the serial and message to them.

Enjoy!

"At DIC we be serial creating and mailing code ninjas... we also like to email christmas cards" decap.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 02:33PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month