Jump to content

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 = 'rsmith@mysite.com';
$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: info@mysite.com';

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      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers, '-fwebmaster@example.com');
?> 

 

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

 

For more indepth explanation about mail headers etc.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.