> send emails using php ~ Online tutorial

send emails using php

Registration form

We are create registration form which is important in data storing when the entered value in field the data are redirect value to corresponds method by using form tag.Now they store data in Mysql database for furthur processing on the data.

<div align='left'>
<table border='1'>

<form name='form1' action='post' method='reglog.php'>
//In which the HTML values will be redirected to reglog.php program using POST method is used

<table bgcolor='skyblue' border='1'>
<tr><td width='50'>Name:</td><td width='50'><input type='name' name='name' placeholder='Enter the Name'>
<tr><td width='50'>Password:</td><td width='50'><input type='password' name='pass' placeholder='Enter the password'>
<tr><td width='50'>Retype password:</td><td width='50'><input type='password' name='pass' placeholder='Retype Password'>
<tr><td width='50'>Email id:</td><td width='50'><input type='text' name='email' placeholder='Enter the Email id'>
<tr><td width='50'></td><td width='70'><input type='submit' value='Submit'>

Mysql connectivity

Now we are going to create the database for storing data in verification process .using following MYSQL syntax to create database in MYSQL

Common Syntax
Create database
create database database_name;
Use database
use database_name;
create table query
create table tab_name(tab_name varchar(20),tab_name1 varchar(20),tab_name3 varchar(20),tab_name4 varchar(20),));

Sending mail in php:

Now we are create database connectivity for the program

$tbl_name=name of table;
// Random confirmation code
// values sent from form
$insert=mysql_query("insert into table_name(name,pass,repass,email)values('$name','$pass','$repass','$email')");
$subject="Your confirmation link here";
$header="from: your name ";
$message="Your Comfirmation link \r\n";
$message.="Click on this link to activate your account \r\n";
$sentmail = mail($to,$subject,$message,$header);
echo "Not found your email in our database";
echo "Your Confirmation link Has Been Sent To Your Email Address.";
else {
echo "Cannot send Confirmation link to your e-mail address";

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
Powered By: BloggerYard.Com