View Full Version : Sending email via PHP

05-09-2006, 08:34 AM
okay so i have a form located @ http://bigfooty.hacksawed.com/email.html

this form basically gets data and posts it to another page called submit.php

submit.php then emails our email at hacksawed@gmail.com

the problem is, i want to allow it to send html rather than text, and for that html to be displayed accordingly (like a website) in our email account.

the code for email.html is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Anonymous Email Sender</title>

<form id="form1" name="form1" method="post" action="submit.php">
<input type="text" name="textfield" />
<textarea name="textarea" cols="100" rows="20"></textarea>
<input type="submit" name="Submit" value="Submit" />

The code for submit.php is:

# ----------------------------------------------------
# -----
# ----- This script was generated by the demo version of PHP-Form 1.1 on 8/05/2006 at 7:59:15 PM
# -----
# ----- http://www.websitedatabases.com
# -----
# ----------------------------------------------------
# -----
# ----- Many Features are available only in the Full version, to order please follow this link :
# -----
# ----- http:// www.websitedatabases.com/form-form/index.html
# -----
# ----------------------------------------------------

// Receiving variables
@$textfield = addslashes($_POST['textfield']);
@$textarea = addslashes($_POST['textarea']);

// Validation
//Sending Email to form owner
# Email to Owner
$pfw_header = "From: bigfooty@gmail.com";
$pfw_subject = "#textfield#";
$pfw_email_to = "hacksawed@gmail.com";
$pfw_message = "$textarea\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

header("Location: login.html");


im not sure what to write in submit.php to make it email html rather than coding.

can anyoen help???

05-09-2006, 02:37 PM
There is a HTML mail example here

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum