[eluser]Neeraj Kumar[/eluser]
Following Pseudo Code may help you!!
1. Fetch user data.
2. Process data using form_validation. If valid goto step 3 or goto step 1.
3. Prepare and SQL Query like: 'INSERT INTO table_name VALUES...'
4. Fire Query using $this->db->query();
5. Then Initialize Email class.
6. Send an Email to the the person
7. Check if email has been successfully sent or not. If successfully sent then exit otherwise goto next step
8. Delete the last entry from the database and throw an error
I hope it helps!!
Cheers