Posted by Kud on Mon 30th Apr 02:15
download | new post
- <?php /*
- include('config.php');
- $objet = 'Premier test !';
- $corps = "C'est un premier test d’envoi d’un email en php.\n" ;
- $corps .= "Ceci est la forme la plus simple de l’emploi de la fonction mail() \n";
- $headers ='From: "Kud"<[email protected]>'."\r\n";
- $headers .='Reply-To: [email protected]'."\r\n";
- $headers .='Content-Type: text/html; charset="iso-8859-1"'."\r\n";
- $headers .='Content-Transfer-Encoding: 8bit'."\r\n";
- $headers .='X-Mailer: PHP/' . phpversion();
- $sql = "SELECT * from compte where com_id != " . $_SESSION['id'];
- $result = pg_query($sql);
- while ($destinataire = pg_fetch_array($result))
- {
- mail($destinataire['com_courriel'], $objet, $corps, $headers);
- }
- */?>
- <?php
- // multiple recipients
- $to .= '[email protected]';
- // subject
- $subject = 'Birthday Reminders for August';
- // body
- $body = '
- <html>
- <head>
- <title>Birthday Reminders for August</title>
- </head>
- <body>
- <p>Here are the birthdays upcoming in August!</p>
- <table>
- <tr>
- <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
- </tr>
- <tr>
- <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
- </tr>
- <tr>
- <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
- </tr>
- </table>
- </body>
- </html>
- ';
- // To send HTML mail, the Content-type header must be set
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- // Additional headers
- // Mail it
- ?>
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.