2016-10-03 6 views
-1

私は自分のウェブサイトにサインアップすると、自動的にウェルカムメール(phpファイル)を送信するPHPコードを作成しようとしています。次のように::ようこそ誰かがサインアップしたときにPHP

<?php 
    //15 2 2015 
    session_start(); 
    if(!isset($_SESSION["login"])) 
     header("location:logout.php"); 
?> 
<?php include('contactus-freelancer.php'); ?> 
<?php include('../db.php'); ?> 
<?php 
$email = $_SESSION['email']; 
$to = "$email"; 
$subject = "Welcome mail"; 

mail ('''what goes here is my question''''); 

echo '<a href="Home.php"></a>'; 
?> 

をしかし、私は私のPHPスクリプト

mail();

言うwhiich PHPスクリプトにメール-PHPファイル/ボディを追加するためにどのようにそれを把握することができませんでしfollowsLとしての私のメーリングスクリプト::

<?php include('home.php'); ?> 
<?php 
    //15 2 2015 
    session_start(); 
    if(!isset($_SESSION["login"])) 
     header("location:logout.php"); 
?> 
<?php include('db.php'); ?> 


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
     <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
     <meta name="format-detection" content="telephone=no" /> <!-- disable auto telephone linking in iOS --> 
     <title>Respmail is a response HTML email designed to work on all major email platforms and smartphones</title> 

    </head> 
    <body bgcolor="#E1E1E1" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> 

     <center style="background-color:#E1E1E1;"> 
      <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;"> 
       <tr> 
        <td align="center" valign="top" id="bodyCell"> 

         <table bgcolor="#E1E1E1" border="0" cellpadding="0" cellspacing="0" width="500" id="emailHeader"> 

          <!-- HEADER ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="10" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%"> 
                   <tr> 


                   </tr> 
                  </table> 
                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // END --> 

         </table> 

         <table bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0" width="500" id="emailBody"> 



          <?php 
           $email = $_SESSION['email']; 
           $sql = "SELECT * FROM fuser WHERE email = '$email' "; 
           $result = $conn->query($sql); 
           if ($result->num_rows > 0) { 

           while($row = $result->fetch_assoc()) { 

          ?> 

          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <!-- 
             The centering table keeps the content 
             tables centered in the emailBody table, 
             in case its width is set to 100%. 
            --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%" style="color:#FFFFFF;" bgcolor="#3498db"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <!-- 
                The flexible container has a set width 
                that gets overridden by the media query. 
                Most content tables within can then be 
                given 100% widths. 
               --> 
               <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td align="center" valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <!-- 
                  The content table is the first element 
                   that's entirely separate from the structural 
                   framework of the email. 
                  --> 
                  <table border="0" cellpadding="30" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="center" valign="top" class="textContent"> 
                     <h1 style="color:#FFFFFF;line-height:100%;font-family:Helvetica,Arial,sans-serif;font-size:35px;font-weight:normal;margin-bottom:5px;text-align:center;"><small>Hello <?php echo strtoupper ($row["name"]); ?> </small><br> <br>Welcome to GraduateFreelancers</h1> 
                     <h2 style="text-align:center;font-weight:normal;font-family:Helvetica,Arial,sans-serif;font-size:23px;margin-bottom:10px;color:#205478;line-height:135%;"><small>OUR JOB IS TO FIND YOU A JOB</small></h2> 
                     <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;">GraduateFreelancers is India’s one of the growing online career and recruitment resource with its global essencia technology provides relevant profiles to employers and relevant jobs to job-seekers across industry verticals, experience levels and geographies. Best rated by people have registered on the site over largest Indian network.</div> 
                    </td> 
                   </tr> 
                  </table> 
                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 

          <tr mc:hideable> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td valign="top" width="500" class="flexibleContainerCell"> 


                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 




          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#F8F8F8"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td align="center" valign="top" width="500" class="flexibleContainerCell"> 
                  <table border="0" cellpadding="30" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="center" valign="top"> 

                     <!-- CONTENT TABLE // --> 
                     <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
                      <tr> 
                       <td valign="top" class="textContent"> 

                        <h3 mc:edit="header" style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;">Thank You</h3> 
                        <div mc:edit="body" style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-left:-25%; margin-bottom:0;color:#5F5F5F;line-height:135%; width:150%;">Let me take this opportunity to thank you for choosing GraduateFreelancers to provide you the finest opportunities and services. We are proud to welcome satisfied freelancers and look forward to many years of working together.<br><br>If you have any questions about our services, we invite you to get in touch with out customaer care available at <i><b>[email protected]</b></i>, and we will be happy to assist you 24/7.</div> 
                       </td> 
                      </tr> 
                     </table> 
                     <!-- // CONTENT TABLE --> 

                    </td> 
                   </tr> 
                  </table> 
                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 


          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="left" valign="top" class="flexibleContainerBox"> 
                     <table border="0" cellpadding="0" cellspacing="0" width="210" style="max-width: 100%;"> 
                      <tr> 
                       <td align="left" class="textContent"> 
                        <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:CENTER; width:130%;">Complete your Profile</h3> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%;">We care about your career more than anyone else, which gives us an opportunity to let you know that a complete profile with uploaded CV gets noticed by Recruiters more than the othere who haven't.</div> 
                       </td> 
                      </tr> 
                     </table> 
                    </td> 
                    <td align="right" valign="middle" class="flexibleContainerBox"> 
                     <table class="flexibleContainerBoxNext" border="0" cellpadding="0" cellspacing="0" width="210" style="max-width: 100%;"> 
                      <tr> 
                       <td align="left" class="textContent"> 
                        <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center; margin-right:-50%; width:180%;">Upload a Profile picture</h3> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:155%; margin-right:-50%; width:180%;">Recruiters get what they see. And now to help them get to know you better, we requerst you to take a bit effort to upload your profile picture.</div> 
                       </td> 
                      </tr> 
                     </table> 
                    </td> 
                   </tr> 
                  </table> 
                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 


          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr style="padding-top:0;"> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td style="padding-top:0;" align="center" valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <table border="0" cellpadding="0" cellspacing="0" width="50%" class="emailButton" style="background-color: #3498DB;"> 
                   <tr> 
                    <td align="center" valign="middle" class="buttonContent" style="padding-top:15px;padding-bottom:15px;padding-right:15px;padding-left:15px;"> 
                     <a style="color:#FFFFFF;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:20px;line-height:135%;" href="www.graduatefreelancers/freelancerssign/" target="_blank">LogIn Here</a> 
                    </td> 
                   </tr> 
                  </table> 
                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 
          <!-- MODULE ROW // --> 


          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td align="center" valign="top" width="500" class="flexibleContainerCell"> 
                  <table border="0" cellpadding="30" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="center" valign="top"> 

                     <!-- CONTENT TABLE // --> 
                     <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
                      <tr> 
                       <td valign="top" class="textContent"> 
                        <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;">Projects Related to your Streams</h3> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-top:3px;color:#5F5F5F;line-height:135%;">Now let us get to the business. Here are some paid projects recruiters have posted from past two weeks.</div> 
                       </td> 
                      </tr> 
                     </table> 
                     <!-- // CONTENT TABLE --> 

                    </td> 
                   </tr> 
                  </table> 
                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 


          <!-- MODULE DIVIDER // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td align="center" valign="top" width="500" class="flexibleContainerCell"> 
                  <table class="flexibleContainerCellDivider" border="0" cellpadding="30" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="center" valign="top" style="padding-top:0px;padding-bottom:0px;"> 

                     <!-- CONTENT TABLE // --> 
                     <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
                      <tr> 
                       <td align="center" valign="top" style="border-top:1px solid #C8C8C8;"></td> 
                      </tr> 
                     </table> 
                     <!-- // CONTENT TABLE --> 

                    </td> 
                   </tr> 
                  </table> 
                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // END --> 



          <?php 
           $category1 = $row["category1"]; 
           $sql2 = "SELECT * FROM input WHERE category1 = '$category1' ORDER BY date DESC LIMIT 2"; 
           $result2 = $conn->query($sql2); 
           if ($result2->num_rows > 0) { 

           while($row2 = $result2->fetch_assoc()) { 

          ?> 



          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="left" valign="top" class="flexibleContainerBox"> 
                     <table border="0" cellpadding="0" cellspacing="0" width="210" style="max-width:100%;"> 
                      <tr> 
                       <td align="left" class="textContent"> 
                        <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:10px;margin-bottom:3px;text-align:center; width:130%; margin-left:10%;"><?php echo ($row2["title"]); ?></h3> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%; margin-left:10%;"><?php echo ($row2["description"]); ?></div> 
                       </td> 
                      </tr> 
                     </table> 
                    </td> 

                   </tr> 
                  </table> 
                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 



          <?php  } 
          } else { 
           echo "0 results"; 
            } 
          ?> 

          <?php 
           $category2 = $row["category2"]; 
           $sql3 = "SELECT * FROM input WHERE category1 = '$category2' ORDER BY date DESC LIMIT 2"; 
           $result3 = $conn->query($sql3); 
           if ($result3->num_rows > 0) { 

           while($row3 = $result3->fetch_assoc()) { 

          ?> 

          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="left" valign="top" class="flexibleContainerBox"> 
                     <table border="0" cellpadding="0" cellspacing="0" width="210" style="max-width:100%;"> 
                      <tr> 
                       <td align="left" class="textContent"> 
                        <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:10px;margin-bottom:3px;text-align:center; width:130%; margin-left:10%;"><?php echo ($row3["title"]); ?></h3> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%;margin-left:10%;"><?php echo ($row3["description"]); ?></div> 
                       </td> 
                      </tr> 
                     </table> 
                    </td> 

                   </tr> 
                  </table> 
                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 



          <!-- // END --> 

          <?php  } 
          } else { 
           echo "0 results"; 
            } 
          ?> 

          <?php  } 
           } else { 
            echo "0 results"; 
             } 
            $conn->close(); 
          ?> 





          <!-- MODULE ROW // --> 
          <tr> 
           <td align="center" valign="top"> 
            <!-- CENTERING TABLE // --> 
            <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
             <tr> 
              <td align="center" valign="top"> 
               <!-- FLEXIBLE CONTAINER // --> 
               <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer"> 
                <tr> 
                 <td valign="top" width="500" class="flexibleContainerCell"> 

                  <!-- CONTENT TABLE // --> 
                  <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"> 
                   <tr> 
                    <td align="center" valign="top" class="flexibleContainerBox" style="background-color:#5F5F5F;"> 
                     <table border="0" cellpadding="30" cellspacing="0" width="100%" style="max-width:100%;"> 
                      <tr> 
                       <td align="center" class="textContent"> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;">How are we doing. Please take a moment to give us your feed back.</div><br> 
                        <h3 style="color:#FFFFFF;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;"><b>FEED BACK</b></h3>                     
                       </td> 
                      </tr> 
                     </table> 
                    </td> 
                    <td align="center" valign="top" class="flexibleContainerBox" style="background-color:#27ae60;"> 
                     <table class="flexibleContainerBoxNext" border="0" cellpadding="30" cellspacing="0" width="100%" style="max-width:100%;"> 
                      <tr> 
                       <td align="center" class="textContent"> 
                        <div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;">Are we doing good?. Please let your Appreciation reach us.</div><br> 
                        <h3 style="color:#FFFFFF;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;"><b>DONATE</b></h3>                      
                       </td> 
                      </tr> 
                     </table> 
                    </td> 
                   </tr> 
                  </table> 
                  <!-- // CONTENT TABLE --> 

                 </td> 
                </tr> 
               </table> 
               <!-- // FLEXIBLE CONTAINER --> 
              </td> 
             </tr> 
            </table> 
            <!-- // CENTERING TABLE --> 
           </td> 
          </tr> 
          <!-- // MODULE ROW --> 





        </td> 
       </tr> 
      </table> 
     </center> 
    </body> 
</html> 

注:私は 任意の提案をサインアップするユーザーへのメールとして全体郵送スクリプトを取得する必要がありAppre

+0

明確にわからないものは何ですか?あなたは詳細に記述できますか? –

+0

あなたの体をphpファイルの1つの変数に割り当てます。つまり、$ msg = "here here";メール機能の前にそのファイルを入れて、$ msg –

+0

と言うと、私のサイトにサインアップします..サイトは自動的にあなたにメールを送ります。メールID ...ここに私は.phpコードでメールを持っています..しかし、あなたのメールIDにメールを送信するためのアクションを行うために必要なPHPは問題があります..私の歓迎メールは "ハイ"のテキストを持って..今私は上記のコードにそのファイルを追加する? – harishk

答えて

1

男あなたが望むものが分かっているかどうかわからない場合は、ご使​​用のシステムにサインアップする際に電子メールを送信する方法を尋ねられますが、ここに貼り付けたコードは、 。

コメントを読むことから、私はhtmlテンプレートで電子メールを送信したいと考えています。私はあなたのコードで動作するようにしようとしたが、それはあまりにも長い間、私はちょうど最初の300行残りをやっています、あなたが自分でそれを終えることができ、ここで:

 <?php 


      $headers = "MIME-Version: 1.0" . "\r\n"; 
      $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // set content type to html 
      $headers = "From: Your System Name <[email protected]> \r\n"; 




      $message = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\" id=\"bodyTable\" style=\"table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;\" align=\"center\">"; 
      $message .="<tr>"; 
      $message .="<td align=\"center\" valign=\"top\" id=\"bodyCell\">"; 
      $message .="<table bgcolor=\"#E1E1E1\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" id=\"emailHeader\">"; 
        // HEADER ROW 
         $message .="<tr>"; 
         $message .="<td align=\"center\" valign=\"top\">"; 
           // CENTERING TABLE 
         $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"; 
         $message .="<tr>"; 
         $message .="<td align=\"center\" valign=\"top\">"; 
              // FLEXIBLE CONTAINER 
         $message .= "<table border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">"; 
               $message .= "<tr>"; 
                $message .="<td valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">"; 

                 // CONTENT TABLE // 
                 $message .="<table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"; 
                 $message .="<tr>"; 


                 $message .="</tr>"; 
                 $message .="</table>"; 
                $message .="</td>"; 
               $message .="</tr>"; 
              $message .="</table>"; 
              // FLEXIBLE CONTAINER 
             $message .="</td>"; 
            $message .="</tr>"; 
           $message .="</table>"; 
           // CENTERING TABLE 
          $message .="</td>"; 
         $message .="</tr>"; 
         // END 

        $message .="</table>"; 

        $message .="<table bgcolor=\"#FFFFFF\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" id=\"emailBody\">"; 




          $email = $_SESSION['email']; 
          $sql = "SELECT * FROM fuser WHERE email = '$email' "; 
          $result = $conn->query($sql); 
          if ($result->num_rows > 0) { 

          while($row = $result->fetch_assoc()) { 


          $message .="<tr>"; 
          $message .="<td align=\"center\" valign=\"top\">"; 
           //CENTERING TABLE 
           /* 
            The centering table keeps the content 
            tables centered in the emailBody table, 
            in case its width is set to 100%. 
           */ 
           $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"color:#FFFFFF;\" bgcolor=\"#3498db\">"; 
           $message .="<tr>"; 
           $message .="<td align=\"center\" valign=\"top\">"; 

              /* FLEXIBLE CONTAINER 

               The flexible container has a set width 
               that gets overridden by the media query. 
               Most content tables within can then be 
               given 100% widths. 
              */ 

              $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">"; 
              $message .="<tr>"; 
              $message .="<td align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">"; 

               /* CONTENT TABLE // --> 
                 <!-- 
                 The content table is the first element 
                  that's entirely separate from the structural 
                  framework of the email. 
                */ 
                 $message .="<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"100%\">"; 
                  $message .="<tr>"; 
                 $message .="<td align=\"center\" valign=\"top\" class=\"textContent\">"; 
                 $message .="<h1 style=\"color:#FFFFFF;line-height:100%;font-family:Helvetica,Arial,sans-serif;font-size:35px;font-weight:normal;margin-bottom:5px;text-align:center;\"><small>Hello".strtoupper($row['name'])."</small><br> <br>Welcome to GraduateFreelancers</h1>"; 

                 $message .="<h2 style=\"text-align:center;font-weight:normal;font-family:Helvetica,Arial,sans-serif;font-size:23px;margin-bottom:10px;color:#205478;line-height:135%;\"><small>OUR JOB IS TO FIND YOU A JOB</small></h2>"; 
                 $message .="<div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;\">GraduateFreelancers is India’s one of the growing online career and recruitment resource with its global essencia technology provides relevant profiles to employers and relevant jobs to job-seekers across industry verticals, experience levels and geographies. Best rated by people have registered on the site over largest Indian network.</div>"; 
                   $message .="</td>"; 
                  $message .="</tr>"; 
                 $message .="</table>"; 
                 // CONTENT TABLE 

                $message .="</td>"; 
               $message .="</tr>"; 
              $message .="</table>"; 
              // FLEXIBLE CONTAINER 
             $message .="</td>"; 
            $message .="</tr>"; 
           $message .="</table>"; 
           // CENTERING TABLE 
          $message .="</td>"; 
         $message.= "</tr>"; 

         $message .="<tr mc:hideable>"; 
         $message .="<td align=\"center\" valign=\"top\">"; 
           // CENTERING TABLE 
         $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"; 
            $message .="<tr>"; 
             $message .="<td align=\"center\" valign=\"top\">"; 
              //FLEXIBLE CONTAINER 
              $message .="<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">"; 
               $message .="<tr>"; 
                $message .="<td valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">"; 


                 // CONTENT TABLE 

                $message .="</td>"; 
               $message .="</tr>"; 
              $message .="</table>"; 
              // FLEXIBLE CONTAINER 
             $message .="</td>"; 
            $message .="</tr>"; 
           $message .="</table>"; 
           // CENTERING TABLE 
          $message.="</td>"; 
         $message .="</tr>"; 
         // MODULE ROW 




       // MODULE ROW // 
         $message .="<tr>"; 
          $message .="<td align=\"center\" valign=\"top\">"; 
           //CENTERING TABLE // 
           $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"#F8F8F8\">"; 
           $message.="<tr>"; 
             $message .="<td align=\"center\" valign=\"top\">"; 
              // FLEXIBLE CONTAINER 
              $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">"; 
              $message .="<tr>"; 
                $message .="<td align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">"; 
                 $message .="<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"100%\">"; 
                  $message.="<tr>"; 
                   $message .="<td align=\"center\" valign=\"top\">"; 

                    // CONTENT TABLE 
                    $message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"; 
                     $message .="<tr>"; 
                      $message .="<td valign=\"top\" class=\"textContent\">"; 

                       $message .="<h3 mc:edit=\"header\" style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;\">Thank You</h3> 
                       <div mc:edit=\"body\" style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-left:-25%; margin-bottom:0;color:#5F5F5F;line-height:135%; width:150%;\">Let me take this opportunity to thank you for choosing GraduateFreelancers to provide you the finest opportunities and services. We are proud to welcome satisfied freelancers and look forward to many years of working together.<br><br>If you have any questions about our services, we invite you to get in touch with out customaer care available at <i><b>[email protected]</b></i>, and we will be happy to assist you 24/7.</div> 
                      </td> 
                     </tr> 
                    </table> 
                    // CONTENT TABLE --> 

                   </td> 
                  </tr> 
                 </table> 
                </td> 
               </tr> 
              </table> 
              <!-- // FLEXIBLE CONTAINER --> 
             </td> 
            </tr> 
           </table> 
           <!-- // CENTERING TABLE --> 
          </td> 
         </tr>"; 
        // MODULE ROW --> 


         // <!-- MODULE ROW // --> 
         $message.="<tr> 
          <td align=\"center\" valign=\"top\"> 
           <!-- CENTERING TABLE // --> 
           <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> 
            <tr> 
             <td align=\"center\" valign=\"top\"> 
              <!-- FLEXIBLE CONTAINER // --> 
              <table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\"> 
               <tr> 
                <td valign=\"top\" width=\"500\" class=\"flexibleContainerCell\"> 

                 <!-- CONTENT TABLE // --> 
                 <table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> 
                  <tr> 
                   <td align=\"left\" valign=\"top\" class=\"flexibleContainerBox\"> 
                    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"210\" style=\"max-width: 100%;\"> 
                     <tr> 
                      <td align=\"left\" class=\"textContent\"> 
                       <h3 style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:CENTER; width:130%;\">Complete your Profile</h3> 
                       <div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%;\">We care about your career more than anyone else, which gives us an opportunity to let you know that a complete profile with uploaded CV gets noticed by Recruiters more than the othere who haven't.</div> 
                      </td> 
                     </tr> 
                    </table> 
                   </td> 
                   <td align=\"right\" valign=\"middle\" class=\"flexibleContainerBox\"> 
                    <table class=\"flexibleContainerBoxNext\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"210\" style=\"max-width: 100%;\"> 
                     <tr> 
                      <td align=\"left\" class=\"textContent\"> 
                       <h3 style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center; margin-right:-50%; width:180%;\">Upload a Profile picture</h3> 
                       <div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:155%; margin-right:-50%; width:180%;\">Recruiters get what they see. And now to help them get to know you better, we requerst you to take a bit effort to upload your profile picture.</div> 
                      </td> 
                     </tr> 
                    </table> 
                   </td> 
                  </tr> 
                 </table> 
                 <!-- // CONTENT TABLE --> 

                </td> 
               </tr> 
              </table> 
              <!-- // FLEXIBLE CONTAINER --> 
             </td> 
            </tr> 
           </table> 
           <!-- // CENTERING TABLE --> 
          </td> 
         </tr>"; 
         // MODULE ROW --> 

        // MODULE ROW // 
         $message .="<tr> 
          <td align=\"center\" valign=\"top\"> 

           <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> 
            <tr style=\"padding-top:0;\"> 
             <td align=\"center\" valign=\"top\"> 

              <table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\"> 
               <tr> 
                <td style=\"padding-top:0;\" align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\"> 

                 <!-- CONTENT TABLE // --> 
                 <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"50%\" class=\"emailButton\" style=\"background-color: #3498DB;\"> 
                  <tr> 
                   <td align=\"center\" valign=\"middle\" class=\"buttonContent\" style=\"padding-top:15px;padding-bottom:15px;padding-right:15px;padding-left:15px;\"> 
                    <a style=\"color:#FFFFFF;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:20px;line-height:135%;\" href=\"www.graduatefreelancers/freelancerssign/\" target=\"_blank\">LogIn Here</a> 
                   </td> 
                  </tr> 
                 </table> 
                 <!-- // CONTENT TABLE --> 

                </td> 
               </tr> 
              </table> 
              <!-- // FLEXIBLE CONTAINER --> 
             </td> 
            </tr> 
           </table> 
           <!-- // CENTERING TABLE --> 
          </td> 
         </tr>"; 
         // MODULE ROW --> 
         // MODULE ROW // --> 


         // MODULE ROW // --> 
         $message .="<tr> 
          <td align=\"center\" valign=\"top\"> 
           <!-- CENTERING TABLE // --> 
           <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> 
            <tr> 
             <td align=\"center\" valign=\"top\"> 
              <!-- FLEXIBLE CONTAINER // --> 
              <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\"> 
               <tr> 
                <td align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\"> 
                 <table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"100%\"> 
                  <tr> 
                   <td align=\"center\" valign=\"top\"> 

                    <!-- CONTENT TABLE // --> 
                    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> 
                     <tr> 
                      <td valign=\"top\" class=\"textContent\"> 
                       <h3 style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;\">Projects Related to your Streams</h3> 
                       <div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-top:3px;color:#5F5F5F;line-height:135%;\">Now let us get to the business. Here are some paid projects recruiters have posted from past two weeks.</div> 
                      </td> 
                     </tr> 
                    </table> 
                    <!-- // CONTENT TABLE --> 

                   </td> 
                  </tr> 
                 </table> 
                </td> 
               </tr> 
              </table> 
              <!-- // FLEXIBLE CONTAINER --> 
             </td> 
            </tr> 
           </table> 
           <!-- // CENTERING TABLE --> 
          </td> 
         </tr>"; 




         mail($email, "Welcome", $message,$headers); 
         ?> 

そしてまた、私はあなたがPDOの書類を作成し使用することをお勧めします。コードがあなたに合っていないかどうか私に教えてください。

+0

まあ、私はサインアップのために別々のコードを持っています。質問には言及していませんでした...あなたの答えは私には意味がありますが...私は少し疑いがあります。 '$ name = 'xxx';のような変数を定義し、次のように同じ名前の別の変数を定義すると、 '$ name = 'yyy';' $ nameの最初に書き込まれた値は上書きされます。もし私がそうであれば、複数の$ message変数がどのように動作するかを教えてください。ありがとう.. – harishk

+0

$ message = "hellow"; $ message。= "World"; 文字列を組み合わせるときに使用する演算子 "。=" を確認します。基本的には、表示される複数の$ message変数を1つの変数に連結します。 あなたの質問 –

+0

にもう一度お答えします。あなたは "/"を使用して二重引用符の要件がある場合は背中..記載されている場合、私はあなたがそれらの300行を作った方法全体のスクリプトを作った..コードはメール自体のHTMLページとしてそれ自身を実行する?like ...あなたが$ message = "こんにちは"のようなスクリプトを持っているなら、それはメールに「こんにちは;」と表示されるはずです。それでも、私はそれを聞きたいです..ありがとう – harishk

0

this for referenceを使用できます。「HTML電子メールを送信する」のセクションを参照してください。 ご質問の通りメール( '' 'ここには私の質問があります' '');

PHPのメール機能は、より多くの測定値のためにmail functionのためのPHPのドキュメントを確認してください

mail($to, $subject, $message, $headers); 

としてフォーマットされます。

+0

こんにちは@ChristopherLaconsay私はあなたのコードを使用する場合、私はここで私の質問を理解したと仮定します。私は、唯一のボディーが "to、sub、msg、head .."になるメールを手に入れます。しかし、上記の "Mail Script"を本文として必要とします。理解していなければ元に戻してください。ありがとうございます.. – harishk

+1

私はあなたの質問を正しく理解しているかどうかは分かりませんが、基本的に、HTMLを送信したい場合は、変数($ messageなど)に格納してメールに渡すしか方法がありません関数。私があなたに与えたリンクを読むと、あなたはそれがどのように行われるかを見るでしょう。 –

+0

私は理解しました。あなたが見ることができるように、私は(問題で言及された)htmlコードをたくさん持っています。どうすればいいですか? – harishk

関連する問題