I have following PHP code to submit single input:
<?php
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$mailTo = 'user@gmail.com';
$mailFrom = 'user@gmail.com';
$subject = 'Call Back EN';
$body = ($_GET['number']) ? $_GET['number'] : $_POST['number'].'<br />';
$body .= 'Server IP:'.gethostbyaddr($_SERVER['REMOTE_ADDR']).'<br />';
$body .= 'Czas:'.date('Y-m-d H:i:s').'<br />';
mail($mailTo, $subject, $number, "From: ".$mailFrom);
?>
But the only field I’m getting by email is number – what I’m doing wrong?
the
bodyis act like email contents,but you supplied it using variable
$number,that is why you only getting number in your email
second problem, where is the
$headers?http://php.net/manual/en/function.mail.php
this should give you clearer picture