• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

[PHP] Mail Function (Why Do I suck?)

bozley05

NLC
NLC
Another what should be easy problem from me, i've really gotta learn php... can u tell me why this doesnt work??

PHP:
<?php 
mail("my@email.com", "$subject", 
Name: $name  Firm: $firm  Phone: $phone  Fax: $fax  E-Mail: $email  Address: $postal_address  Suburb: $suburb  State: $state
  Postcode: $postcode  Product 1: $product_1 QTY: $qty_for_product_1  Product 2: $product_2 QTY: $qty_for_product_2  Product 3: $product_3 QTY: $qty_for_product_3  Product 4: $product_4 QTY: $qty_for_product_4  Product 5: $product_5 QTY: $qty_for_product_5,
     "From: webmaster@$SERVER_NAME\r\n"
    ."Reply-To: webmaster@$SERVER_NAME\r\n"
    ."X-Mailer: PHP/" . phpversion());
?>

Cheers...
 
Make things easier for yourself.

PHP:
<?php 
$subject="Order";
$to="email@email.com";

$message = "Name: $name  Firm: $firm  Phone: $phone  Fax: $fax  E-Mail: $email  Address: $postal_address  Suburb: $suburb  State: $state

  Postcode: $postcode  Product 1: $product_1 QTY: $qty_for_product_1  Product 2: $product_2 QTY: $qty_for_product_2  Product 3: $product_3 QTY: $qty_for_product_3  Product 4: $product_4 QTY: $qty_for_product_4  Product 5: $product_5 QTY: $qty_for_product_5,";

    $headers = "From: webmaster@$SERVER_NAME\r\n";

    $headers .= "Reply-To: webmaster@$SERVER_NAME\r\n";

    $headers .= "X-Mailer: PHP/" . phpversion()";
mail($to, $subject, $message. $headers);

?>
 
Back
Top