Jump to content

PHP Mail Headers are the suck!


DarkNSF

Recommended Posts

so far this seems to send to my catch-all account, but it blocks it EVERYWHERE else (yahoo, gmail); it doesn't even put it in the spam folder. I've tried 30x combinations and I can't seem to get the header information correct.. It's driving me insane!

 

 

Can anyone shed some light on the problem?

 

http://www.Valhalla-Studios.com/contact.php

 

  // send mail function
  function core_mail($toaddress, $toname, $fromaddress, $fromname, $emailsubject, $msg)
  {
    $headers = "To: ".$toname." <".$toaddress.">\r\n";
    $headers = "From: ".$fromname." <".$fromaddress.">\r\n";
    $headers .= "Reply-To: ".$fromname." <".$fromaddress.">\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html;charset=ISO-8859-9\r\n";
  /*
    $headers  = "";
    $headers .= "X-Sender:  ".$fromname." <".$fromaddress.">\n";
    $headers .= "From: ".$fromname." <".$fromaddress.">\n";
    $headers .= "Reply-To: ".$fromname." <".$fromaddress.">\n";
    $headers .= "Date: ".date("r")."thom@".$_SERVER['SERVER_NAME'].">\n";
    $headers .= "Message-ID: ".date("YmdHis")."";
    $headers .= "X-Mailer: PHP v".phpversion()." on ".$_SERVER['SERVER_NAME']."\n";
    $headers .= "Return-Path: ".$fromname." <".$fromaddress.">\n";
    $headers .= "Delivered-to: ".$fromname." <".$fromaddress.">\n";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html;charset=ISO-8859-9\n";
    $headers .= "Importance: High\n";
    $headers .= "X-MSMail-Priority: High\n";
    */

    mail($toaddress, $emailsubject, $msg, $headers);
  }

Link to comment
Share on other sites

    $headers = "MIME-Version: 1.0" ."\r\n";

    $headers .= "Content-type: text/html;charset=ISO-8859-9" ."\r\n";

 

    $headers .= "To: $toname <$toaddress>" ."\r\n";

    $headers .= "From: $fromname <$fromaddress>" ."\r\n";

 

 

2 things, you are missing a . with one of your = signs and your mail page definitions should go at the top (content type etc..) You don't really need a reply-to either, you have a From header.

Link to comment
Share on other sites

thanks, that first error didn't affect anything because to is set in the mail(), however, it should still be fixed.

 

Still not getting mail to yahoo..

 

 

  // send mail function
  function core_mail($toaddress, $toname, $fromaddress, $fromname, $emailsubject, $msg)
  {
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html;charset=ISO-8859-9\r\n";
    $headers .= "To: ".$toname." <".$toaddress.">\r\n";
    $headers .= "From: ".$fromname." <".$fromaddress.">\r\n";
  /*
    $headers  = "";
    $headers .= "X-Sender:  ".$fromname." <".$fromaddress.">\n";
    $headers .= "From: ".$fromname." <".$fromaddress.">\n";
    $headers .= "Reply-To: ".$fromname." <".$fromaddress.">\n";
    $headers .= "Date: ".date("r")."thom@".$_SERVER['SERVER_NAME'].">\n";
    $headers .= "Message-ID: ".date("YmdHis")."";
    $headers .= "X-Mailer: PHP v".phpversion()." on ".$_SERVER['SERVER_NAME']."\n";
    $headers .= "Return-Path: ".$fromname." <".$fromaddress.">\n";
    $headers .= "Delivered-to: ".$fromname." <".$fromaddress.">\n";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html;charset=ISO-8859-9\n";
    $headers .= "Importance: High\n";
    $headers .= "X-MSMail-Priority: High\n";
    */

    mail('', $emailsubject, $msg, $headers);

  }

Link to comment
Share on other sites

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.