Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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???

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There is a HTML mail example here
    http://uk2.php.net/manual/en/function.mail.php


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •