For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > January 2006 > Re: [PHP-INSTALL] php and mail









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-INSTALL] php and mail
php@karsites.net

2006-01-25, 7:56 am


Hi Ron.

Looks OK to me, apart from the header part.

Try dropping the header params and see if that does the
trick. It maybe that is where the problem is. Do you know
there is a space in the charset definition that may be
causing problems?

> text/html; charset=i so-8859-1 \n");

^

If the mail gets sent without the headers, try reintroducing
the headers to the mail function, with the headers all hard
coded without any php vars.

HTH

Keith

from the manual:

<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

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

In theory, theory and practice are the same;
In practice they are not.

On Tue, 24 Jan 2006, Ron Geringer wrote:

> To: php-install@lists.php.net
> From: Ron Geringer <rong@prairiesys.com>
> Subject: [PHP-INSTALL] php and mail
>
> Hi:
>
> I have a short script that use in php to send email out
> acknowledging email and sending web generated notces.
>
> mail($to, $subject, $body,"From: $from \nContent-Type:
> text/html; charset=i so-8859-1 \n");
>
> Recently we've set up a new server but php won't send mail
> generated by this script.
>
> We've checked our sendmail and everything else seems to
> work except for this script. In addition, it appears that
> any application we have on the server that relys on php is
> failing to send email as well.
>
> Does anyone have any suggestions
>
> Thanks Much
>
> Ron

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com