Re: newbie: no mail() is sent

Re: newbie: no mail() is sent

am 05.04.2008 07:09:48 von sandy_saydakov

On Apr 4, 11:35 pm, "R.A.M." wrote:
> I have created a test page on which I send test email using mail() function.
> The problem is that although I receive 1 as result of mail(), no email is
> sent.
> $sent = mail($toadress, $subject, $message, $headers);
>
> After call, $sent === 1.
> I have sendmail installed.

Well, first let's get the basics right: by saying "no email is sent"
you are going too far. No email is received would be closer to the
reality, but it still can be received, but, say, in a junk mail folder
because your (or your providers) spam filter decided so.

Getting success from calling mail() probably means that it could
connect to localhost:25 according to your configuration, and pass the
message to sendmail. Next sendmail would try to pass it further, but
something can prevent it from doing that. For example, firewall or
misconfiguration. Try running mailq to see if messages are stuck in
the spool. Also try sending from the command line: echo balh-blah |
mailx -s subject addr@domain

/sandy
http://myphpquiz.com/

newbie: no mail() is sent

am 05.04.2008 08:35:03 von r_ahimsa_m

I have created a test page on which I send test email using mail() function.
The problem is that although I receive 1 as result of mail(), no email is
sent.
Here is main part of the code:

$toadress = 'r_ahimsa_m@poczta.onet.pl';
$subject = 'Test';
$message = 'To jest test.' .
$headers = "MIME-Version: 1.0\r\nContent-type: text/html;
charset=iso-8859-2\r\n";
$sent = mail($toadress, $subject, $message, $headers);

After call, $sent === 1.
I use Fedora 8 Linux and PHP5.
Here is part of /etc/php.ini:

SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i

I have sendmail installed.
Could you help me please?
/RAM/

Re: newbie: no mail() is sent

am 05.04.2008 10:10:44 von petersprc

Hi,

Do you have any errors you can see in /var/log/maillog or /var/log/
mail.log? Maybe try an alternate destination address... Having
error_reporting(E_ALL) may show some notices.

Not sure if you have a typo, but line 3 should have a semicolon at the
end of the line instead of a dot.

Regards,

John Peters

On Apr 5, 2:35 am, "R.A.M." wrote:
> I have created a test page on which I send test email using mail() function.
> The problem is that although I receive 1 as result of mail(), no email is
> sent.
> Here is main part of the code:
>
> $toadress = 'r_ahims...@poczta.onet.pl';
> $subject = 'Test';
> $message = 'To jest test.' .
> $headers = "MIME-Version: 1.0\r\nContent-type: text/html;
> charset=iso-8859-2\r\n";
> $sent = mail($toadress, $subject, $message, $headers);
>
> After call, $sent === 1.
> I use Fedora 8 Linux and PHP5.
> Here is part of /etc/php.ini:
>
> SMTP = localhost
> smtp_port = 25
> sendmail_path = /usr/sbin/sendmail -t -i
>
> I have sendmail installed.
> Could you help me please?
> /RAM/