PHP contact form not working? [closed]

General Tech Learning Aids/Tools . 2 years ago

  0   2   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 5 Rating

Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Write Your Comments or Explanations to Help Others



Tuteehub forum answer Answers (2)


profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

First i want to start by saying this is my first time with PHP outside of reading.

I am just trying to create a simple contact form that will gather the information and send me the email with the information. Currently my contact page is down and any help would be awesome to get it back up.

Here is my Code:

php

if(isset($_POST['Submit'])) {
if(!empty($_POST['CompanyName'])){
    if(!empty($_POST['Email']){
        $CompanyName = $_POST['CompanyName'];
        $PhoneNumber = $_POST['PhoneNumber'];
        $Email = $_POST['Email'];
        $IndustryType = $_POST['IndustryType'];
        $Website = $_POST['Website'];
        $Other = $_POST['Other'];
        $Comments =$_POST['comments'];
        $formcontent ="From: $CompanyName \n Message: \n Point of Contact: $NameInput \n Email: $Email \n Industry: $IndustryType $Other \n Website: $Website \n  Comments: $Comments";
        $recipient = "keeano@doodleinc.co"; 
        $subject = "Website Contact\ $IndustryType";
        $mailHeader = "From $Email \r\n";
        echo '

Thank you for contacting color="#709900">Doodle Inc., someone will contact you within 48 hours.

'
; mail($Email, $subject, $formcontent); } else { echo 'Please Check required fields with an color="#FF0000">* .\n If you are exsperiancing any technical issues or have not heard back from us please contact us at Techsupport@doodleinc.co'; } } }?> class="article">

send us an email ...

class="clr">
name="contact_form" method="post" action="mail.php" onSubmit="return evalid()"> border="0"> class="Form"> for="NameInput">Your Name: color="#FF0000">* id="NameInput" name="NameInput"/> for="CompanyName">Your Company: color="#FF0000">* id="CompanyName" name="CompanyName"/> id="PhoneNumber" name="PhoneNumber">Phone: id="PhoneNumber" name="PhoneNumber"/> id="Email" name
0 views   0 shares
profilepic.png
manpreet 2 years ago

Use the library phpmailer to send emails. You can find some tutorials about how use it


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community