Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-09-2006, 07:34 AM   PM User | #1
HackSawed
New to the CF scene

 
Join Date: May 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
HackSawed is an unknown quantity at this point
Sending email via PHP

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:

Code:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Anonymous Email Sender</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="submit.php">
  <label>Subject:
  <input type="text" name="textfield" />
  </label>
  <p>
    <label>Message
    <textarea name="textarea" cols="100" rows="20"></textarea>
    </label>
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="Submit" />
    </label>
  </p>
</form>
</body>
</html>
The code for submit.php is:

Code:
<?php
# ----------------------------------------------------
# -----
# ----- 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???
HackSawed is offline   Reply With Quote
Old 05-09-2006, 01:37 PM   PM User | #2
degsy
Senior Coder

 
Join Date: Nov 2002
Location: North-East, UK
Posts: 1,265
Thanks: 0
Thanked 0 Times in 0 Posts
degsy is on a distinguished road
There is a HTML mail example here
http://uk2.php.net/manual/en/function.mail.php
degsy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:14 PM.


Advertisement
Log in to turn off these ads.