Onzeon Posted April 27, 2011 Share Posted April 27, 2011 I've been at this for days, and the more I read the more confusing it gets. What I want to achieve is: I have a XHTML form with 5 user input fields - These are: name subject cust_email telephone details I need to create a PHP script that will on user click - submit a email that has this format (secured if possible: From= cust_email Subject= "Customer requested information on" +subject eMail body= name + "requests information on" + subject /n + details /n + "Contact information" /n +telephone +email. So the body would look some how like this: Jane Smith requests information on Botox Hello I'm interested in botox injections please contact me with pricing and availability. Thank you. Contact information. (888)555-1212 [email protected] Can you or anyone of the users in this wonderful forum HELP. I'm a print designer and I can assist you guys with anything you may need in print. But web is all to new and I'm struggling. Thank you, thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/234915-can-any-php-guru-point-me-in-the-right-direction-thanks/ Share on other sites More sharing options...
Pikachu2000 Posted April 27, 2011 Share Posted April 27, 2011 Post the form markup, along with the PHP that you've tried and describe the problems you're having. Please post them in . . . BBCode tags . . . Quote Link to comment https://forums.phpfreaks.com/topic/234915-can-any-php-guru-point-me-in-the-right-direction-thanks/#findComment-1207281 Share on other sites More sharing options...
jedeye Posted April 28, 2011 Share Posted April 28, 2011 From just looking at what you're typing. To create those 'carrage returns' and 'line feeds' you use "\n\r" your slashes are backwards. Alternatively you can just Google "free contact form" and find a ton of them for free without having to know a bit of PHP. Quote Link to comment https://forums.phpfreaks.com/topic/234915-can-any-php-guru-point-me-in-the-right-direction-thanks/#findComment-1207285 Share on other sites More sharing options...
Onzeon Posted April 28, 2011 Author Share Posted April 28, 2011 Thank you for your quick reply: Here is the HTML form: <form action="send_contact.php" method="post" enctype="multipart/form-data" id="ContactForm"> <div class="container"> <div class="col-1"> <label> <strong>Name:</strong><br /> <input type="text" name="name" id="name" class="input" /> </label> <label> <strong>Subject:</strong><br /> <input type="text" name="subject" id="subject" class="input" /> </label> <label> <strong>E-mail:</strong><br /> <input type="text" name="email" id="customer_mail" class="input" /> </label> <label> <strong>Telephone:</strong><br /> <input type="text" name="telephone" id="telephone" class="input" /> </label> </div> <div class="col-2"> <strong>Write your details here.</strong><br /> <textarea name="detail" cols="10" rows="10" id="detail"></textarea> </div> </div> <div class="container"> <div class="right"> <a href="#" class="link" onclick="document.getElementById('ContactForm').reset()"><span><span>Limpar</span></span></a> <a href="#" class="link" onclick="document.getElementById('ContactForm').submit()"><span><span>Enviar</span></span></a> </div> </div> </form> AND HERE IS MY 1st LAME ATTEMPT AT A PHP Script. <?php // Enter your email address $to ='[email protected]'; // Name $name = $_POST['name']; // Details $message = $_POST['message']; // Mail of sender $email = $_POST['email']; $body = "$name "sent you a message": $message"; $send_contact=mail($to,$subject,$detail,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We received you email, Thank you"; } else { echo "ERROR"; } ?> SO I GAVE UP ON THAT ONE AND MY 2nd LAME ATTEMPT AT A PHP Script. <?php // Contact subject $subject ="$assunto"; // Details $message="$detail"; // Name $name="$name"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $name <$mail_from>"; // Enter your email address $to ='[email protected]'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We received you email, Thank you"; } else { echo "ERROR"; } ?> ANY HELP IS APPRECIATED> Quote Link to comment https://forums.phpfreaks.com/topic/234915-can-any-php-guru-point-me-in-the-right-direction-thanks/#findComment-1207289 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.