Jump to content

mail() not delivering to gmail or hotmail


jakebur01

Recommended Posts

ok... my form that I made will not deliver to hotmail or gmail...

 

What is the problem??

 

<?php

$name = $_POST['name'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$feedback = $_POST['message'];


$name = trim($name);
$company = trim($company);
$phone = trim($phone);
$email = trim($email);
$feedback = trim($feedback);

$toaddress = '[email protected]';
$subject = 'Website Form - mysite.com';
$mailcontent = 'Customer name: '.$name."\n"
.'Customer company: '.$company."\n"
.'Customer e-mail: '.$email."\n"
.'Customer phone: '.$phone."\n"
."Customer comments: \n".$feedback."\n";

// header information not including sendTo and Subject
// these all go in one variable.  First, include From:

$fromaddress = 'From: [email protected]';

mail($toaddress, $subject, $mailcontent, $fromaddress);

?>

Link to comment
https://forums.phpfreaks.com/topic/54140-mail-not-delivering-to-gmail-or-hotmail/
Share on other sites

<?php
$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers, '[email protected]');
?> 

 

http://www.bath.ac.uk/bucs/email/anatomy.shtml

 

For more indepth explanation about mail headers etc.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.