هيلبرنت | Helpernt

هيلبرنت | Helpernt (https://www.helpernt.com/vb/index.php)
-   ركن تطوير المواقع (https://www.helpernt.com/vb/forumdisplay.php?f=88)
-   -   انشاء نموذج اتصال بنا باستخدام php و phpmalier (https://www.helpernt.com/vb/showthread.php?t=9647)

Mohamed yasser 08-18-2019 09:08 PM

انشاء نموذج اتصال بنا باستخدام php و phpmalier
 

السلام عليكم ورحمة الله وبركاته
كييفية انشاء نموذج اتصال باستخدام php و PHPMalier
الرساله الي اتكتبه في النموذج اتوصل للبريد بتاعك علشان تقدر ترسله لصاحب البريد تاني
الطريقه ده ناس كتيرررررر اوي كانت عيزاها
ان شاء الله القادم اجمل
https://i.imgur.com/pS8W1z5.png

كود العمل
كود PHP:

<html lang="en" class="" id="net">
    <head>

        <meta charset="utf-8">
        <title>send mail (Mohamed yasser)</title>
        <link href="css/bootstrap.css" rel="stylesheet">
    </head>
    <body>
       <div class="row">
        <div class="col-md-4" style="margin: 30px 30px 30px 400px;  direction: rtl;">
        <div class="panel panel-default">
            <div class="panel-heading"> sand mail</div>
              <form method="post">
                <div class="panel-body">
                 <div class="control-group form-group">
                 <div class="controls">
                     <label style="text-align: right;">email</label>
                        <input type="text" class="form-control" name="email" />
                           <p class="help-block"></p>
                    </div>
                      </div>
                      <div class="control-group form-group">
                       <div class="controls">
                       <label style="text-align: right;">Name</label>
                       <input type="text" class="form-control" name="Name" />
                        <p class="help-block"></p>
                         </div>
                        </div>
                        
                        <div class="control-group form-group">
                       <div class="controls">
                       <label style="text-align: right;">subject</label>
                       <input type="text" class="form-control" name="subject" />
                        <p class="help-block"></p>
                         </div>
                        </div>

                         <div class="control-group form-group">
                       <div class="controls">
                       <label style="text-align: right;">BODY</label>
                       <textarea name="body" class="form-control" rows="6"></textarea>
                        <p class="help-block"></p>
                         </div>
                        </div>
                        <div class="form-group">
                         <div class="panel-footer">
                          <button type="submit" class="btn btn-block btn-primary" name="send">send</button>
                          </div>
                          </div>
                        </form>
                            <?
                            
use PHPMailer\PHPMailer\PHPMailer;
                            if(isset(
$_POST['send']))
                            {
                                
$Name $_POST["Name"];
                                
$email $_POST["email"];
                                
$subject $_POST["subject"];
                                
$body $_POST["body"];
                                
                                require_once 
"PHPMailer\Exception.PHP";
                                require_once 
"PHPMailer\PHPMailer.PHP";
                                require_once 
"PHPMailer\SMTP.PHP";
                                
                                
$mail = new PHPMailer();
                                
                                
$mail-> isSMTP();
                                
$mail-> SMTPAuth true;
                                
$mail-> Host "smtp.gmail.com";
                                
$mail-> Username "البريد";
                                
$mail-> Password "كلمة المرور";
                                
$mail-> SMTPSecure "ssl";
                                
$mail-> Port "465";
                                
                                
$mail-> isHtml(True);
                                
$mail-> setFrom("$email","$Name");
                                
$mail-> addAddress("$email");
                                
$mail-> Subject $subject;
                                
$mail-> Body $body;
                                if(
$mail->send())
                                {
                                    
$success '<div class="alert alert-success">success send</div>';
                                }else{
                                    
$faild '<div class="alert alert-danger">faild send</div>';
                                }

                            }
                            echo 
$success;
                            echo 
$faild;
                            
?>
                </div>
        </div>
    <body>
</html>

الملف كامل
تحميل الملف

وده الفديوا ذي كل مره



هيلبرنت 08-21-2019 09:27 PM

رد: انشاء نموذج اتصال بنا باستخدام php و phpmalier
 
موهوب مافيش كلام clap


الساعة الآن 09:44 AM

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. TranZ By Almuhajir