Forum Moderators: coopster

Message Too Old, No Replies

Fomatting e-mail being sent

         

PHPnewbie03

12:05 pm on Jun 3, 2003 (gmt 0)

10+ Year Member


Hello!
With everyone's help I was able to send the contents of my form via e-mail.
Now, it's just a formatting issue. The form works when this code is used:
<?php
extract($_POST);
$msg = $_POST['first_name'];
$msg .= $_POST['last_name'];
$msg .= $_POST['address_line_1'];
$msg .= $_POST['address_line_2'];
$msg .= $_POST['city'];
$msg .= $_POST['state'];
$msg .= $_POST['zip'];
$msg .= $_POST['telephone'];
$msg .= $_POST['email'];
$msg .= $_POST['website_url'];
$msg .= $_POST['comments'];

mail("name@domain.com","TEST Feedback Form",$msg,"From: $email\r\n" . "Reply-To: $email\r\n");

?>

But it [b]doesn't[/b] work when I use this:
<?php

extract($_POST);
$msg = "Name: " . $_POST['first_name'] . " ";
$msg .= $_POST['last_name'] . "\n\r";
$msg .= "Address:\n\r" . $_POST['address_line_1'] . "\n\r";
$msg .= $_POST['address_line_2'] . "\n\r";
$msg .= $_POST['city'] . ", ";
$msg .= $_POST['state'] . " ";
$msg .= $_POST['zip'] . "\n\r\n\r";
$msg .= "Tel.: " . $_POST['telephone'] . "\n\r";
$msg .= "Email: " . $_POST['email'] . "\n\r";
$msg .= "Web Site: " . $_POST['website_url'] . "\n\r";
$msg .= "Comments:\n\r" . $_POST['comments'];

mail("name@domain.com","TEST Feedback Form",$msg,"From: $email\r\n" . "Reply-To: $email\r\n");

?>

Any thoughts....

Glacai

12:25 pm on Jun 3, 2003 (gmt 0)

10+ Year Member



Hi PHPnewbie03,

Try:
$email = $_POST['email'];
$msg .= "Email: $email\n\r";

PHPnewbie03

1:16 pm on Jun 3, 2003 (gmt 0)

10+ Year Member


Thank you,
I will try this out!