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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post

    Text Box within PHP Mailer

    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.

    PHP Code:
    <?
        $reply
    "Your Message Has Been Recieved!";
        
    $firstname=trim($firstname);
        
    $lastname=trim($lastname);
        
    $phone=trim($phone);
        
    $fax=trim($fax);
        
    $address=trim($address);
        
    $email=trim($email);
        
    $body=trim($body);
        
    $subject=trim($subject);

        
    $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.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,074
    Thanks
    11
    Thanked 98 Times in 96 Posts
    assuming $message holds the textarea data

    PHP Code:
    <?
    ."Order: <br /><br />" nl2br$message ) ; 
    ?>
    nl2br() replaces newlines with HTML <br/>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post
    legend, works perfect. ta


  •  

    Posting Permissions

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