forword mail

the mail() function

Moderators: egami, macek, gesf

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

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.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest