View Full Version : Text Box within PHP Mailer

05-08-2004, 06:23 PM
Ok. Well this would be my first real question that ive posted. i normally just browse, read and help were i can.

I have created an order form for a nursery and wish to have the contents of a text box act so that when the user presses enter and types on the next line, it will show that in the mail.

$reply= "Your Message Has Been Recieved!";

$toaddress = "serex@messiahsoft.net"; // mail to address
$confsub = "Order Confirmation";
$confirm = "<body><font color=black size=1><br><br>Hello, $firstname $lastname.<br><br>
Your order has been recieved. We will contact you as soon as we can. <br><br>Thanks from <a href='http://www.killuke.com.au' target='_blank'>Killuke Nursery</a></font>";
$subjct = "Order Through Killuke Website" ;
$mailcontent = "<body>Name: ".$firstname." ".$lastname."<br>"
."Email: ".$email."<br>"
."Phone: ".$phone."<br>"
."Fax: ".$fax."<br>"
."Address: ".$address."<br>"
."Order: <br><br>".$message;
mail($toaddress, $subjct, $mailcontent,"From: \"$email\" <$address>\nContent-Type: text/html; charset=iso-8859-1");
mail($email, $confsub, $confirm, "From: \"Killuke Nursery\" <$address>\nContent-Type: text/html; charset=iso-8859-1");
Thanks, <? echo "$firstname $lastname"; ?>. Your order
has been sent to us. We have also sent an email to <? echo "$email"; ?> confirming
your order.

this is action page to the form. i was thinking of having a text box next to all items on the stock list, but with a 4 page stock list i thought no.

if there is any way around this i would apreciate the help.

05-09-2004, 02:42 AM
assuming $message holds the textarea data

."Order: <br /><br />" . nl2br( $message ) ;

nl2br() replaces newlines with HTML <br/>

05-09-2004, 04:09 AM
legend, works perfect. ta :thumbsup: