How can i send mail through basic mail() function of core php
- 6 years ago
you have not put any details here. what error you are getting or what wrong with you. Please Mention full detail about your Problem for our Better understanding.
for send Mail try This maybe Work for you :
<?php
$to = "firstperson@demo.com, secondperson@demo.com";
$subject = "HTML email";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <sender@demo.com>' . "\r\n";
$headers .= 'Cc: mainperson@demo.com' . "\r\n";
mail($to,$subject,$message,$headers);
?>
- 6 years ago
you have not put any details here. what error you are getting or what wrong with you. Please Mention full detail about your Problem for our Better understanding.
for send Mail try This maybe Work for you :
<?php
$to = "firstperson@demo.com, secondperson@demo.com";
$subject = "HTML email";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <sender@demo.com>' . "\r\n";
$headers .= 'Cc: mainperson@demo.com' . "\r\n";
mail($to,$subject,$message,$headers);
?>
- 5 years ago
Hot Questions