I am no expert in coding with php and I am having problems with my E-mail.
The problem is this: I am seeing Mime Version an Content-Type appearing inside my email body.
So how can I avoid showing this inside my mail body? THX guys!!
My mail looks like this:
MIME-Version: 1.0 <–want to HIDE THIS!!
Content-Type: text/html; charset=UTF-8 <–and hide THIS!!
From:Some name
Email: some.mail@yahoo.com
message:
some message
My code:
if (!$errors) {
$user = $_POST['email'];
$mail = 'dejo.dekic@yahoo.com'; //send mail to me
$subject = 'Kontakt';
$tema = 'Info';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From: ' . $_POST['name'] . "\n";
$headers .= 'Email: ' . $_POST['email'] . "\n";
$headers .= "Message:\n" . $_POST['message'] . "\n\n";
$add_headers = 'From: mail@robertpeic.com' . "\r\n". "Return-path: mail@robertpeic.com" . "\r\n";
$poruka ='Vaš kontakt je uspjesno zaprimljen! Odgovorit ću vam u najkraćem mogućem roku. Hvala! Molimo ne odgovarajte na ovu poruku. Ova poruka je automatska.';
mail($mail, $subject, $headers, $add_headers, "-fmail@robertpeic.com");
mail($user, $tema, $poruka, $add_headers, "-fmail@robertpeic.com");
echo "<div class='hvala' style='color:white;margin:0px auto;padding-top:20px;width:290px;background-color:white;font-weight:bold;text-align:center;'><p>Hvala Vam na kontaktu!</p></div>";
}
Try below code: