I am trying to send email from my contact us form on my site.
At the moment i am testing it on my localhost, with these php.ini settings:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = pop3.mail.dk
; http://php.net/smtp-port
smtp_port = 110
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = svenne50@hotmail.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =
Is this correct set up?
What should "sendmail_from" be? Im not sure I am doing that correct, or?
My processing script looks like this:
<?php
// Contact subject
$subject = $_POST['subject'];
// Message from sender
$message = $_POST['detail'];
// Mail of sender
$mail_from = $_POST['customer_mail'];
// Name of sender
$name = $_POST['name'];
// Enter your email address
$to ='svenne50@hotmail.com';
$headers = "MIME-Version: 1.0 . \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 . \r\n";
$headers .= "From: $mail_from . \r\n";
$send_contact = (mail($to, $subject, $name, $message, $headers));
if($send_contact){
echo "Tak for din forespørgsel.";
//header('location: index.php');
}
else {
echo "ERROR";
}
?>
I get the succes confirmation efter submitting, but the email never arrives in my inbox.
Does someone know how this can be?
Jan