Shoutbox

Help with PHP mail - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Help with PHP mail (/showthread.php?tid=27362)

Help with PHP mail by leito on 06-18-2004 at 05:18 AM

I'm using this code, I just change the Headers, and stop working. Can someone help me figuring out what happen?, thank you very much.

    mail($email_address, $subject, $message,
        "From: Leonel Galán<leonelgalan@mysite.com>\r\n"
    ."Reply-To: leonelgalan@anothersite.com\r\n"
    ."X-Mailer: PHP/" . phpversion());

I add the headers, because my mail was treated as SPAM by some mailfilters, so I thought headers could help.


RE: Help with PHP mail by KeyStorm on 06-18-2004 at 06:40 AM

It looks ok, but I think you should'nt avoid the Mime-Type header. Anyway, why don't you define the headers like in

code:

/* Para enviar correo HTML, puede definir la cabecera Content-type. */
$cabeceras  = "MIME-Version: 1.0\r\n";
$cabeceras .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* cabeceras adicionales */
$cabeceras .= "To: Maria <maria@example.com>, Kelly <kelly@example.com>\r\n";
$cabeceras .= "From: Recordatorio <cumpleanyos@example.com>\r\n";
$cabeceras .= "Cc: archivo@example.com\r\n";
$cabeceras .= "Bcc: chequeo@example.com\r\n";


Taken from the spanish PHP-doc
RE: Help with PHP mail by leito on 06-18-2004 at 05:03 PM

But the Message isn't HTML, and.... can TO be a header (cabecera)??  I'll try that, hope the SPAM Filters dont mess with my emails.


RE: Help with PHP mail by KeyStorm on 06-19-2004 at 12:34 PM

I'm afraid that if you define X-Mailer: PHP/" . phpversion()) it won't help your mails to pass the spamfilter, since this means the email was sent automatically.

You have to change the mime-type, obviously. :google: it and choose the one that fits your needs ;)


RE: Help with PHP mail by Chris.1 on 06-19-2004 at 10:30 PM

code:
// Headers so we can have HTML encoded emails
$headers = "From: $fromName <$email>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html";
       
// Check to see if the mail was sent
if(mail($to,"Email Form",$message,$headers)) {


The above is taken from my mail script. $to comtains the email address, $Message contains the actual message and the headers part is pretty self explanitory.

Hope that helps