-
Notifications
You must be signed in to change notification settings - Fork 5
/
email_sendmail_html.php
executable file
·44 lines (39 loc) · 1.04 KB
/
email_sendmail_html.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// multiple recipients
$to = '[email protected]' . ', '; // note the comma
$to .= '[email protected]';
// subject
$month = date("M",time());
$subject = "Birthday Reminders for $month";
// message
$message = <<<EOT
<html>
<head>
<title>Followup Reminders for $month</title>
</head>
<body>
<p>Please be sure to followup with these individuals in $month!</p>
<table>
<tr>
<th>Person</th><th>Title</th><th>Company</th>
</tr>
<tr>
<td>Joe Morgan</td><td>CTO</td><td>Yahoo</td>
</tr>
<tr>
<td>Sally Schmidt</td><td>VP of Development</td><td>Google</td>
</tr>
</table>
</body>
</html>
EOT;
// 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
$headers .= 'To: ' . $to . "\r\n";
$headers .= 'From: Followup Reminder <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>