الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

contact us form مشكله في

بدأه nazoome25 في 2 مايو 2012 · 1 رد · 488 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

انا عملت صفحه تواصل معانا ونزلت برنامج mozilla thundered بحيث الرسائل توصل فيه والادمن يرد عن طريقها

المشكله ان بالبدايه كود اشتغل بعد كذا فجاءه صار لما الشخص يحاول يتواصل مع الادمن تطلع رسائله عفوا لا يمكن تواصل الخ

انا عملت صفحتين صفحه اسمها contactus.php

<?php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Rosy Shop - Contact Us</title> 
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<br />
<br />
<h1>Contact Us Page </h1>
<br />
<br />
<a href="contactus.txt">View Code</a>
<div class="content">
   <center>
   <div class="table">
   <div class='head' align="center">Please fill in the form below to contact us:</div>
   <form name="form1" method="post" action="sendmessage.php">
<table width="100%">
  <tr>
       <td width="16%"><p>Subject</p></td>
       <td width="2%">:</td>
       <td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
  </tr>
  <tr>

       <td><p>Description</p></td>
       <td>:</td>
       <td><textarea name="description" cols="39" rows="5" id="description"></textarea></td>
  </tr>
  <tr>
       <td><p>Name</p></td>
       <td>:</td>
       <td><input name="cname" type="text" id="cname" size="50"></td>
  </tr>
  <tr>
       <td><p>Email</p></td>
       <td>:</td>
       <td><input name="user_mail" type="text" id="user_email" size="50"></td>
  </tr>
  <tr>
      <td> </td>
      <td> </td>
      <td><input type="submit" name="submitbtn" value="Send Message"></td>
  </tr>

</table>
    </div>
    </form>
    </center>
</div>
</body>
</html>

?>

والصفحه الثانيه sendmessage.php

<?php

<html>
<head>
<title> Send Message </title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<br />
<br />
<h1> Rosy Shop </h1>
<br />
<br />
<a href="sendmessage.txt">View Code</a>
</body>
</html>

<?php


$subject ="$subject";                                                                                          //set variable for sender subject

$message="$description";                                                                                       //set variable for sender description

$mail_from="$user_mail";                                                                                      //set variable for sender email address

$header="from: $cname <$mail_from>";

$to ='nazoome@localhost';                                                                                      //email address where the message will be send to                                              

$sendmessage=mail($to,$subject,$message,$header);

if($sendmessage){
echo ("<h3>Thank You. Your message has been deliver to us and we will reply to you shortly. To go back to the Homepage <a href='homepage.php'>Click Here</a></h3>");                 //display message if sender message has been send successfully
}
else {
echo "<p>Sorry, there is an error, please try to contact us again</p>";                                        //display message if sender message has not been send to oumnia@localhosy
}
?>

?>

و الغلط يطلع بسطر 29 في صفحه sendmessage.php

( ! ) Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\all_php\sendmessage.php on line 29

Call Stack

# Time Memory Function Location

1 0.0015 374032 {main}( ) ..\sendmessage.php:0

2 0.0016 374544 mail ( ) ..\sendmessage.php:29

Sorry, there is an error, please try to contact us again

تم تعديل هذه المشاركة بواسطة nazoome25 في 2 مايو 2012 في 21:29

#2

يتبين من رسالة الخطأ بانه لديك مشكلة في إعدادات البرنامج اللي تستخدمه لارسال الايميل وليس في الكود اللي عملته

حاول تضبط smtp و smtp_port في php.ini أو بامكانك تعمل الاعدادات في صفحة وتعمل لها include في صفحتك sendmessage.php

اقراء عن البرنامج اللي تستخدمه ما هي اعدادات smtp اللي يستخدمها

مواضيع مشابهة