我有一個網站啓動並運行,似乎無法讓PHP發送表單數據。有時得到感謝信息,但從未出現在郵件中。我的目標是讓表格收集數據,然後通過電子郵件將數據發送給客戶。PHP通過聯繫表發送電子郵件的麻煩
感謝您的任何幫助。我正在努力去處理php會出現。從電子郵件服務器
<?php
$to = "********@*******.com";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['enquiry'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully";}
else
{print "We encountered anerror sending your mail";}
?>
<section class="container">
<section class="col-lg-6 col-lg-offset-1">
<form class="form-horizontal text-center" role="form" method="post" action="form_send.php">
<div class="form-group">
<label for="Name" class="col-lg-2 control-label">Name:</label>
<div class="col-lg-6">
<input type="name" class="form-control" id="name" name="name" placeholder="Enter Name...">
</div>
</div>
<div class="form-group">
<label for="Email" class="col-lg-2 control-label">Email:</label>
<div class="col-lg-6">
<input type="email" class="form-control" id="email" name="email" placeholder="Enter Email...">
</div>
</div>
<div class="form-group">
<label for="Phone" class="col-lg-2 control-label">Phone:</label>
<div class="col-lg-6">
<input type="phone" class="form-control" id="phone" placeholder="Enter Phone Number...">
</div>
</div>
<div class="form-group">
<label for="Enquiry" class="col-lg-2 control-label">Enquiry:</label>
<div class="col-lg-6">
<textarea type="enquiry" class="form-control" rows="5" id="enquiry" name="enquiry" placeholder="Enter Email..."></textarea>
</div>
</div>
<div class="form-group">
<label for="Enquiry" class="col-lg-2 control-label"></label>
<div class="col-lg-6">
<button class="btn btn-primary" type="submit">Send Message</button>
</div>
</div>
</form>
回覆:
永久性故障的技術細節:谷歌試圖傳達你的信息,但它是由服務器通過aspmx.l收件人域peoplespropertyshop.co.uk拒絕。 google.com。 [2607:f8b0:4003:CO 2 :: 1A]。其他服務器返回的錯誤是:550-5.1.1您嘗試訪問的電子郵件帳戶不存在。請嘗試550-5.1.1仔細檢查收件人的電子郵件地址是否有錯別字或550-5.1.1不必要的空格。請參閱550 5.1.1 support.google.com/mail/bin/answer.py?answer=6596 t6si822722oei.44 - gsmtp
該代碼包含的文件名爲'form_send.php'? – sousdev
您是否安裝了郵件服務器? –
您根本沒有使用$ email變量作爲您的電子郵件。它全部發送到$,我希望它是一個實際的電子郵件地址。 – OIS