Email not getting through

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
bigjoe11a
New php-forum User
New php-forum User
Posts: 137
Joined: Wed Aug 31, 2011 3:55 am
Location: USA
Contact:

Sun Jan 29, 2012 1:31 pm

1st check your junk folder. Make sure that your filtered list includes the domain name from and to the email that your sending.

or if that doesn't work. Try using this. Just change the email names to the ones you want to use. Your sample above doesn't include any header information

Code: Select all

<?php
// recipients email address
$to  = 'admin@domain.com'; // note the comma


// subject
$subject = 'Subject of the message';

// message
$message = 'Type in the body of your message here';

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>' . "\r\n";
$headers .= 'From: My Name <myname@domain.com>' . "\r\n";
$headers .= 'Cc: myname@domain.com' . "\r\n";
$headers .= 'Bcc: myname@domain.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest