doucuan5365 2016-07-28 08:56
浏览 18

我的代码不起作用(php)[重复]

This question already has an answer here:

my code save info in database but doesn't send the message to email and the alert message not work. can you help me , please ?

`

if(isset($_POST['send'])){
$to = "nada_26_@hotmail.com"; // this is your Email address
$subject = "Form contact";
$subject2 = "Copy of your form submission";
$name = $_POST['name'];
$from = $_POST['email'];
$subject3 = $_POST['subject'];
$company = $_POST['company'];
$content = $_POST['message'];
$message = "Name: ".$name ." Subject: " . $subject3 . " Company: " . $company ."

".$content;
$message2 = "Here is a copy of your message " . "

" . $_POST['message'];

$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers); //send the message to the admin
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender


$sql ="INSERT INTO threadnn_arab.contactus VALUES('$name','$from','$subject3','$company','$message','')";
$result=mysql_query($sql); 
         echo "<script> alert('Mail Sent, Thank you, we will contact you shortly.'); </script>";


              header('Location: index.php?#contact');           
            }

?> `


  • 写回答

1条回答 默认 最新

  • dongshendie8849 2016-07-28 09:09
    关注

    i think it on your email provider, smtp may be.or you can using PHPMailer look like in this question Send email from Hotmail using php

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看