Hi all.
I'm new to the forum and novice to PHP. I'm facing a strange problem... at least strange to me :-)
I'm trying to make a contact form which is working perfectly but the message won't be delivered if the recipient is an email alias and not a real address.
Do you think the problem is about my script or the server configuration?
Thanx in advance :-)
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$thesubject = $_POST['thesubject'];
$themessage = $_POST['themessage'];
$todayis = date("l, F j, Y, G:i a") ;
$subject = "Contact Form";
$message = "<html><body><table cellpadding='5' cellspacing='0' border='0'>";
$message .= "<tr><td style='font: bold 13px Arial'>Firstname</td><td style='font: 13px Arial'>$firstname</td></tr>";
$message .= "<tr><td style='font: bold 13px Arial'>Lastname</td><td style='font: 13px Arial'>$lastname</td></tr>";
$message .= "<tr><td style='font: bold 13px Arial'>Email</td><td style='font: 13px Arial'>$email</td></tr>";
$message .= "<tr><td style='font: bold 13px Arial'>Phone number</td><td style='font: 13px Arial'>$phone</td></tr>";
$message .= "<tr><td style='font: bold 13px Arial'>Subject</td><td style='font: 13px Arial'>$thesubject</td></tr>";
$message .= "<tr><td style='font: bold 13px Arial'>Message</td><td style='font: 13px Arial'>$themessage</td></tr>";
$message .= "<tr><td colspan='2'> </td></tr>";
$message .= "<tr><td style='font: bold 11px Arial; color: #555'>Timestamp</td><td style='font: 11px Arial; color: #555'>$todayis</td></tr>";
$message .= "<tr><td style='font: bold 11px Arial; color: #555'>Senders IP address</td><td style='font: 11px Arial; color: #555'>$ip</td></tr>";
$message .= "</table></body></html>";
$to = "Main Recipient <main@recipient.com>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'To: Main Recipient <main@recipient.com>' . "\r\n";
$headers .= 'From: Main Recipient <main@recipient.com>' . "\r\n";
$headers .= 'Cc: Secondary Recipient <secondary@recipient.com>' . "\r\n";
$headers .= 'Bcc: Secret Recipient <secret@recipient.com>' . "\r\n";
mail($to, $subject, $message, $headers);
?>