בכדי לקבוע את כתובת האימייל שממנה תשלח ההודעה כביכול, ובנוסף לקבוע שהטקסט שישלח בתוכן המכתב יפוענח ב- HTML, השתמש בהידרים From ו- Content-type בצורה כזו:
קוד:
$send_to = "to@email.com";
$subject = "The message subject";
$content = "The mail content, HTML available";
$from = "faked@email.com";
///////
$headers = "From: ".$from_address."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=windows-1255\r\n";
mail($send_to, $subject, $content, $headers);