Forum Moderators: coopster

Message Too Old, No Replies

function mail () malfunction

         

NomikOS

3:16 pm on Jul 4, 2008 (gmt 0)

10+ Year Member



Can you imagine why
mail($email, $subject, $body, $headers);
is not function properly?

return true, but a'm not receiving nothing (on gmail) when testing.

I switched to lighttp (from apache) recently.

Thanks.-

[edited by: NomikOS at 3:17 pm (utc) on July 4, 2008]

NomikOS

4:28 pm on Jul 4, 2008 (gmt 0)

10+ Year Member



on apache still malfunction!

NomikOS

5:32 pm on Jul 4, 2008 (gmt 0)

10+ Year Member



I've been testing with gmail. And I looked for spam messages...
f* (it can say f* here?)

In other words: to look into your spam box can help, specially with new domains.

Let's continue with lighttpd : )

-----------------------------------------------------

It is so quit here > ; )

eelixduppy

3:44 am on Jul 7, 2008 (gmt 0)



You have to make sure that everything is properly formed. Also, your headers must be correct, and From MUST be set. If you'd like, give us a quick preview of the code that you are using to send the email with mail() and we'll see if we can work out the bugs.

Also, you might want to look at some of PEARs library's for handling and sending email -- specifically mail_mime and mail. These are very nice, I might add, for sending emails of all kinds.

NomikOS

12:35 am on Jul 8, 2008 (gmt 0)

10+ Year Member



thanks eelixduppy. the problem was resolve. there was no problem really. the messages was arriving to the spamming box on gmail. i'dont use PEAR because overloading considerations. i do all my code.
anyway this is my mail script and thanks you very much for your advices.

<?php

require_once(CORE.'lib/templateMail.php');
function sendMail($data)
{
extract($data);

$from = 'domain';
$reply_to = 'admin@domain.com';

# headers
# -------
$headers = "From: $from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 7bit\n";
$headers .= "Reply-To: $reply_to\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n";
$headers .= "X-Posting-Client: ".getIp()."\n";
$headers .= "X-Sender: <admin@domain.com>\n";
$headers .= "Return-Path: <admin@domain.com>\n";
$headers .= "Errors-to : <admin@domain.com>\n";

if ($priority)
{
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
}

switch ($type)
{
case 'memo':
break;
default :
$template = templateMail($type);
eval("\$subject = \"$template[subject]\";");
eval("\$body = \"$template[body]\";");
break;
}

return @mail($to_email, $subject, $body, $headers);
}
?>

System

7:02 am on Jul 8, 2008 (gmt 0)

redhat



The following message was cut out to new thread by eelixduppy. New thread at: php/3692986.htm [webmasterworld.com]
3:05 am on July 8, 2008 (est -4)