2015-10-15 70 views
0

我試圖得到什麼是問題,但沒有找到out.Please幫助我。這是code.only問題,只有郵件不發送消息將顯示「通過」。 此代碼不是發送郵件,但消息將顯示通過。我已經創建郵件php代碼,但不發送電子郵件

<?php 
$name = $_POST['name']; 
$employeestrength = $_POST['employeestrength']; 
$companyweb = $_POST['companyweb']; 
$contactpersonname = $_POST['contactpersonname']; 
$contactnumber = $_POST['contactnumber']; 
$emailaddress = $_POST['emailaddress']; 
$cityandstste = $_POST['cityandstste']; 
$massege = $_POST['massege']; 
$captch = $_POST['captch']; 

$to = "[email protected]"; 
$subject = "E-mail from HRMSsystem.com for new requirement"; 
$message = "<br>"; 
$message .= "<b>Name :</b> $name <br>"; 
$message .= "<b>Email :</b> $employeestrength <br>"; 
$message .= "<b>organization :</b> $companyweb<br>";  
$message .= "<b>Phone Number:</b> $contactpersonname <br>"; 
$message .= "<b>Comapny :</b> $contactnumber <br>"; 
$message .= "<b>City :</b> $emailaddress <br>"; 
$message .= "<b>Description :</b> $cityandstste <br>"; 
$message .= "<b>Massege :</b> $massege <br>"; 
$message .= "<b>captch :</b> $captch <br>"; 
$message .= "<br>"; 

$header = "From:[email protected] \r\n"; 
$header .= "MIME-Version: 1.0\r\n"; 
$header .= "Content-type: text/html\r\n"; 
$body = "We have received the following information:\n\n"; 

$headers2 = "From:[email protected]"; 

$subject2 = "Request to get listed into HRMSsystem.com"; 

$message2 = "Dear, Thank you for request and details to list into HRMSsystem.com directory. Our team will verify and list your details into directory as soon as possible. Kindly contact [email protected] for more details or questions."; 


$retval = mail($to,$subject,$message,$header); 
mail($to, $subject, $body); 

$send2 = mail($emailaddress, $subject2, $message2,$headers2); 
if($retval == true) 
{ 
    //echo "pass"; 
header('Location: http://localhost:8080/caofficeautomation/'); 
} 
else{ 
echo "Message could not be sent..."; } 



?> 

謝謝 請幫我解決這個問題。

回答

0

此外,請檢查此答案(如果您嘗試從本地主機發送郵件)。

php send mail from localhost

+0

在本地主機的郵件可以發送與否 –