View Full Version : E-Mail isnt be sent.

05-02-2004, 04:24 AM
So my first question on this forum :thumbsup: anyway, I have tried to send e-mail through php and when I tried it out, it would give no error and something would pop up saying symantec scanning and it was go to 100% in like a second so it should of sent the mail, but I never received it.

$to = "address@yahoo.com";
$from = "USER";
$subject = "Test";
$body = "This is just a test message";
print "Thanks for contacting us.<br><br>";
mail ($to,$subject,$body,$from);

***Yes I did substitute address with my real E-Mail***
Does anybody know what could be wrong? I am using Windows 2000 and IIS.

05-02-2004, 04:29 AM
Welcome here!

The first thing to consider is that the mail function doesnt take a "from" argument, so you need to do this:

$header = "From: email@address.com\r\n";

Secondly, is windows set up to send mail? I have heard of problems with the PHP support before. Im afraid I dont know much about this.

$to = "address@yahoo.com";
$header = "From: USER\r\n";
$subject = "Test";
$body = "This is just a test message";
if(mail ($to,$subject,$body,$header)){
print "Thanks for contacting us.<br /><br />";
} else {
print "Mail could not be sent<br /><br />";

05-02-2004, 04:45 AM
I'm pretty sure it does cause I opened IIS and I "granted permission to relay e-mail through this SMTP virtual server" but of course I could be wrong.

05-02-2004, 07:02 PM
Oh, sorry didn't know

05-02-2004, 07:08 PM
We dont allow bumping of topics...

If your thread is not answered then the chances are nobody knows how to help you... Please remember this in the future.

05-03-2004, 09:08 PM
did you add a smtp server in the php.ini file?

05-03-2004, 11:08 PM
I checked the ini file and did a text search and found this:

[mail function]
; For Win32 only.
SMTP = localhost

I don't have to add anything to that do I?

05-03-2004, 11:35 PM
Well assuming that IIS is configured like that I would imagine not, but shouldn't the smtp have it's own IP?