There is a PHP mail form. When I am trying to send the displayed HTML page in textarea to my mail, I am received mail without images and styles that I saw in the textarea.
If anyone could then tell me that how can I send this email to multiple recipients with comma separator in receiver text box I would appreciate it.
PHP mail function is used.
<?php
} else { // the user has submitted the form
// Check if the "from" input field is filled out
if (isset($_POST["sender"])) {
// Check if "from" email address is valid
$mailcheck = spamcheck($_POST["receiver"]);
if ($mailcheck==FALSE) {
echo "Invalid input\n <button onclick=\"goBack()\">Go Back</button>";
} else {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers.= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers.= "From: " . strip_tags($_POST['sender']) . "\r\n";
$headers.= "Reply-To: ". strip_tags($_POST['sender']) . "\r\n";
$receiver = $_POST["receiver"];
$sender = $_POST["sender"];// sender
$subject = $_POST["subject"];
$message = $_POST["message"];
// message lines should not exceed 70 characters (PHP rule), so wrap it
//$message = wordwrap($message, 1000);
// send mail
mail("$receiver",$subject,$message,$headers);
echo "Mail(s) has been sent successfully!\n <button onclick=\"goBack()\">Go Back</button>";
}
}
}
?>