<?php
// multiple recipients
$emailto = 'emailto@example.com';
// note: For Multi emailto user comm
// subject
$subject = 'Email Subject For the mail';
// message
$message = '
<html>
<head>
<title>Title of th email</title>
</head>
<body>
<p>Folling is the Details</p>
<table>
<tr>
<th>Some Name 1</th><th>Some Name 2</th>
</tr>
<tr>
<td>Some Value 1</td><td>Some Value 1</td>
</tr>
<tr>
<td>Some Value 1</td><td>Some Value 1</td>
</tr>
<tr>
<td>Some Value 1</td><td>Some Value 1</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 if required
$headers .= 'To: name 1 <name1@example.com> ' . "\r\n";
$headers .= 'From: Name of the sender <sender@example.com>' . "\r\n";
$headers .= 'Cc: cctothisemail@cctothisemail.com' . "\r\n";
$headers .= 'Bcc: bcctothisemail@cctothisemail.com' . "\r\n";
// Additional headers if required
// Mail it
mail($to, $subject, $message, $headers);
// Mail it
?>
// multiple recipients
$emailto = 'emailto@example.com';
// note: For Multi emailto user comm
// subject
$subject = 'Email Subject For the mail';
// message
$message = '
<html>
<head>
<title>Title of th email</title>
</head>
<body>
<p>Folling is the Details</p>
<table>
<tr>
<th>Some Name 1</th><th>Some Name 2</th>
</tr>
<tr>
<td>Some Value 1</td><td>Some Value 1</td>
</tr>
<tr>
<td>Some Value 1</td><td>Some Value 1</td>
</tr>
<tr>
<td>Some Value 1</td><td>Some Value 1</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 if required
$headers .= 'To: name 1 <name1@example.com> ' . "\r\n";
$headers .= 'From: Name of the sender <sender@example.com>' . "\r\n";
$headers .= 'Cc: cctothisemail@cctothisemail.com' . "\r\n";
$headers .= 'Bcc: bcctothisemail@cctothisemail.com' . "\r\n";
// Additional headers if required
// Mail it
mail($to, $subject, $message, $headers);
// Mail it
?>
I am newbie of this PHP technology, this post helps me to know the introductory of PHP, Thanks for posting such a nice post.
ReplyDeleteRegards,
PHP Training Center in Chennai|PHP Course Chennai