forword mail

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Thu Jan 05, 2012 12:21 am

forword mail

Postby gadesrikanthreddy » Thu Jan 05, 2012 12:33 am

hi friends,

i have webpage it contains contact information page...when i field those fields and click on submit i want get mail to my personal email like gmail,yahoo....hoe can i do it possible ....please guide me .........thanks in advance......

New php-forum User
New php-forum User
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA

Re: forword mail

Postby rupali » Thu Jan 05, 2012 2:54 am

<title>Email </title>
$from = $_POST['from']; // Sender's email id
$to = $_POST['to']; // Receiver's email id
$subject = $_POST['subject'];
$txt= $_POST['message'];

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: '. $from . "\r\n";


echo "mail sent";
<form method="post" action="">
<table cellpadding="10" cellspacing="10">
<td>From </td>
<td><input type="text" name="from"></td>
<td>To </td>
<td><input type="text" name="to"></td>
<td>Subject </td>
<td><input type="text" name="subject"></td>
<td><textarea cols="20" rows="5" name="message"></textarea></td>
<td colspan="2"><input type="submit" name="submit" value="Submit"></td>

Note : Mail feature not execute on localhost machine.

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 2 guests