...

View Full Version : E-Mail isnt be sent.



Haunted
05-02-2004, 03: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.


<?php
$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.

missing-score
05-02-2004, 03: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.


<?php
$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 />";
}
?>

Haunted
05-02-2004, 03: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.

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

missing-score
05-02-2004, 06: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.

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

Haunted
05-03-2004, 10: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?

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum