PHP Sendmail code


<?php

if(isset($_POST[“btn_submit”]))

{

$to = $_POST[“txt_to”];

$from = “MIME-Version:1.0″.”\r\n”;

$from .= “Content-type:text/html;charset=iso-8859-1″.”\r\n”;

$from .= $_POST[“txt_from”] . “\r\n” . “abc@yahoo.com”;
$subject = $_POST[“txt_subject”];

$message = $_POST[“txt_message”] . “<link href=’http://abc.com/template.css&#8217; rel=’stylesheets’ type=’text/html’ />”;

$message = wordwrap($message, 70);

mail($to, $subject, $message, $from);

}

?>

<form action=”send-mail.php” method=”post”>

<table cellpadding=”10px”>

<tr>

<td>To: </td><td><input type=”text” name=”txt_to” /></td>

</tr>

<tr>

<td>From: </td><td><input type=”text” name=”txt_from” /></td>

</tr>

<tr>

<td>Subject: </td><td><input type=”text” name=”txt_subject” /></td>

</tr>

<tr>

<td>Message: </td><td><textarea name=”txt_message” style=”width:350px; height:120px;”></textarea></td>

</tr>

<tr>

<td colspan=”2″><input type=”submit” name=”btn_submit” value=”Send” /></td>

</tr>

</table>

</form>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s