Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/04/2015, 14:33
superweb360
(Desactivado)
 
Fecha de Ingreso: abril-2015
Ubicación: España
Mensajes: 616
Antigüedad: 10 años, 2 meses
Puntos: 74
Respuesta: enviar a 2 correos

Código PHP:
Ver original
  1. <?php
  2. // multiple recipients
  3. $to  = 'aidan@example.com' . ', '; // note the comma
  4. $to .= 'wez@example.com';
  5.  
  6. // subject
  7. $subject = 'Birthday Reminders for August';
  8.  
  9. // message
  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. // To send HTML mail, the Content-type header must be set
  33. $headers  = 'MIME-Version: 1.0' . "\r\n";
  34. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  35.  
  36. // Additional headers
  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. // Mail it
  43. mail($to, $subject, $message, $headers);?>