Forum Moderators: coopster

Message Too Old, No Replies

php Mail function not working on my network?

         

briesm

1:46 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



Hey all. SO i'm almost 100% sure my code is good as I basically copied and pasted the same code I had working on my web server. Now, I have it setup to email a form from a network server php file. The problem is that it isn't working. Neither is a header Location line either for that matter. I'm wondering why this is. Could it be because somehow these require php libraries that they don't have access to? It works fine on my web server.
Here's the code just for kicks, but like I said, it shouldn't be the code:

$to = 'me@example.com ' . ', meagain@example.com';
$subject = 'Quote';

$message = '
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Testing it all Out</title>
</head>
<body><p>This is a test</p>
</body>
</html>
';

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
session_destroy();

header("Location: http://www.example.com");
exit;

}

[edited by: jatar_k at 4:29 pm (utc) on July 7, 2005]
[edit reason] examplified [/edit]

briesm

2:30 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



I also found this snippet on the mail()

For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.

How could I find the PATH on my network even and could that be the issue?

bobnew32

4:17 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



phpinfo() gives great info.