PDA

View Full Version : PHP Mail function help


Vermillion
09-01-05, 11:50 AM
I'm trying to create an HTML form to send an email to a local account on the server.

I've tested the mail server and it can receive emails just fine.

My problem is when I use the following PHP syntax:

<?php
mail("name@domain", "Test Subject", "Message");
?>

I've tested my form to make sure I'm getting the correct information & syntax and it works fine.

But the server never gets the email. I'm wondering if I have a configuration error somewhere in one of the ini files.

Gibb
09-01-05, 11:54 AM
if the server is not setup as an SMTP server with port 25 open, it probably wont work correctly. I had an odd problem where I could run the same script over and over again and it would seem to work intermittently. In my php.ini settings, the mail server path was set as localhost. I changed that to the IP address of the mail server within my company and it started working perfectly.

Vermillion
09-01-05, 12:18 PM
Well the email isn't suppose to go anywhere except to the server itself.

It does have an mail server running with STMP 25 open. Theoretically it should email itself and I should be able to login to my web based local mail client on that machine and access the email.

Since you brought changing the php.ini file, I'll try looking there and modifying that.