联系表格电子邮件到短信不起作用

contact form email to text message is not working

你好,我希望你们能帮帮我,我有这个联系表,可以向技术人员发送电子邮件和他的 phone 号码。

现在一切正常,但他没有收到短信,我觉得好像是他的 phone 出了问题,因为我用了我女朋友 phone 使用相同运营商的号码,她收到了短信很好,其他人也应该收到短信,但是当我发送给他的 phone 时,它就是不起作用...我是否遗漏了什么???,注意:他有 ANDROID,但其他人都有我 PHONE。当我直接从我的 GMAIL 撰写电子邮件并将其发送到他的 PHONE 时,它起作用了 联系表与我的女朋友 phone、经理和其他同事一起工作,有些人拥有与技术人员相同的运营商也能正常工作,但不适合他(技术人员)......这让我感到困惑,请有人帮助!

<?php

$email='1231231234@tmomail.net, 1231231234@tmomail.net,myemail@gmail.com';

$email1=$_POST['Email1'];
$email2=$_POST['Email2'];
$from2=$_POST['Email1'];
$from=$_POST['Email1'];
$subject="Maintenance Request";
//^this is the subject of the email that serivce gets. 
$problem=$_POST['Box'];
$select=$_POST['Select'];
$name=$_POST['Name'];
$phone=$_POST['Phone'];
$number=$_POST['Number'];
$mlocation=$_POST['Machinelocation'];
$orgname=$_POST['OrganisationName'];
//^these information pulls what the customer answers in the field

$message="Name: ".$name."\r\n"."Organization: ".$orgname."\r\n"."Email: ".$from."\r\n"."Phone: ".$phone ."\r\n"."Machine: ".$select."\r\n"."Machine Location: ".$mlocation."\r\n"."Problem: ".$problem ;

$confirmation_subject = 'Your recent Maintenance request';
//^this is the subject of the confirmation email
$confirmation_sender = 'COMPANY NAME HERE<info@youremail.com>';
$msg = "".$name."\r\n" ."Thank you for your recent Maintenance request. A member of our team will respond to your request as soon as possible."."\r\nBelow you will see a copy of your request"."\r\n\n"."Name: ".$name."\r\n"."organization: ".$orgname."\r\n"."Email: ".$from."\r\n"."Phone: ".$phone ."\r\n"."Machine: ".$select."\r\n"."Machine Location: ".$mlocation."\r\n"."Problem: ".$problem ;
//^this is confirmation message message" 

if ($number !=10) {
    die("You are not a human! or your answer was incorrect!, Please go back and try again.");
}
else {
mail ($email1, $confirmation_subject,$msg, 'From: ' .$confirmation_sender );
}

if(!filter_var($email1, FILTER_VALIDATE_EMAIL)) {
    die("Invalid email ($email1)");
}
if ($email1 == $email2) {
    mail ($email, $subject, $message, "from:".$from);
    header("location: siteethankyou.php");
}
else {
    echo "This ($email2) email address is different from ($email1).\n";
}

?>

<div name="my-form" >
<div class="container">  
  <form id="contact" action="EmailHandler.php" method="post">
    <h3>Repair Form</h3>
    <h4>Contact us today, and get reply with in 24 hours!</h4>
    <fieldset>
      <input name="Name" type="text" autofocus required id="Name" placeholder="Your name" tabindex="1">
    </fieldset>
     <fieldset>
      <input name="OrganisationName" type="text" autofocus required id="OrganisationName" placeholder=" Your Organisation Name" tabindex="1">
    </fieldset>
    <fieldset>
      <p>
        <input name="Email1" type="email" autofocus required id="Email1" placeholder="Your Email Address" tabindex="2">
      </p>
      <p class="underfield"><em style="font-size: 10px">please provide your email address to better assist you.</em></p>
    </fieldset>
     <fieldset>
      <input name="Email2" type="email" autofocus required id="Email2" placeholder=" Verify Your Email Address" tabindex="2">
    </fieldset>
    <fieldset>
      <input name="Phone" type="tel" autofocus required id="Phone" placeholder="Your Phone Number" tabindex="3" maxlength="12">
    </fieldset>
  <fieldset>
    <select name="Select" autofocus required class="container" id="Select" onchange="changeSelectValue();">
            <option selected="selected">Select</option>
            <option value="Carpet Machine">Carpet Machine</option>
            <option value="Coffee Brewer">Coffee Brewer</option>
            <option value="Floor Machine">Floor Machine</option>
            <option value="Rider Scrubber Commercial">Rider Scrubber Commercial </option>
            <option value="Rider Scrubber Industrial">Rider Scrubber Industrial</option>
            <option value="Sweeper Commercial">Sweeper Commercial</option>
            <option value="Sweeper Industrial">Sweeper Industrial</option>
            <option value="Vacuum Cleaner">Vacuum Cleaner</option>
            <option value="Water Cooler">Water Cooler</option>
            <option value="Wet / Dry">Wet / Dry</option>
            <option value="Test">Test</option>
            <!--the value has to match the php-->
      </select>
      </fieldset>
      <fieldset>
      <input name="Machinelocation" type="text" autofocus required id="Machinelocation" placeholder="Your Machine Location Address" tabindex="2">
       </fieldset>
      <p class="underfield2"> please provide the address location of the machine. city,state,zipe code</p>
    <fieldset>
      <p>
        <textarea name="Box" autofocus required id="Box" placeholder="What's wrong with your machine...?" tabindex="5"></textarea>
      </p>
    </fieldset>
    
             <fieldset>
      <input name="Number" type="text" autofocus required class="container" id="Question" placeholder="What does 5 + 5 = ?" tabindex="1">
    </fieldset>
    <fieldset>
      <p>&nbsp;        </p>
      <p>
      <input name="submit" type="submit" autofocus class="container4" id="submit" value="Send Request"></p></fieldset>

  </form>
 
  
</div>
</div>

看起来你定义了 $email 但没有使用它。

<?php

if ($number !=10) {
    die("You are not a human! or your answer was incorrect!, Please go back and try again.");
}
else {
mail ($email1, $confirmation_subject,$msg, 'From: ' .$confirmation_sender );
mail ($email, $confirmation_subject,$msg, );
}

if(!filter_var($email1, FILTER_VALIDATE_EMAIL)) {
    die("Invalid email ($email1)");
}
if ($email1 == $email2) {
    mail ($email, $subject, $message, "from:".$from);
    header("location: siteethankyou.php");
}
else {
    echo "This ($email2) email address is different from ($email1).\n";
}

?>