Advertisement
SSYT

Mail Form HTML

Jul 29th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?php
  2. // Destinatari multipli
  3. $to  = 'aidan@example.com' . ', '; // observaΘ›i virgula
  4. $to .= 'wez@example.com';
  5.  
  6. // Subiectul
  7. $subject = 'Birthday Reminders for August';
  8.  
  9. // Mesajul
  10. $message = '
  11. <html>
  12. <head>
  13.  <title>Birthday Reminders for August</title>
  14. </head>
  15. <body>
  16.  <p>Here are the birthdays upcoming in August!</p>
  17.  <table>
  18.    <tr>
  19.      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
  20.    </tr>
  21.    <tr>
  22.      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
  23.    </tr>
  24.    <tr>
  25.      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
  26.    </tr>
  27.  </table>
  28. </body>
  29. </html>
  30. ';
  31.  
  32. // Pentru a trimite mesaje HTML, trebuie stabilit antetul Content-type
  33. $headers  = 'MIME-Version: 1.0' . "\r\n";
  34. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  35.  
  36. // Antete suplimentare
  37. $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
  38. $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
  39. $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
  40. $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
  41.  
  42. // Trimiterea mesajului
  43. mail($to, $subject, $message, $headers);
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement