Jump to content

problem with script or MS network?


lewis987

Recommended Posts

i have a script that allows people to email, it works on every other server except Microsoft network...

 

here is the code: (yes i know its not secure..)

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?PHP
if($_POST['mail']){
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['Subject'];
$message = $_POST['message'];
$mail = mail($to, $subject, $message, 'From: '.$from);
if(!$mail){
	echo "cannot send!";
}
else
{
	echo "Sent sucessfully";
}
}

?>
<form action="" method="post">
to:<br />
<input name="to" type="text" /><br />
from:<br />
<input name="from" type="text" /><br />
subject:<br />
<input name="Subject" type="text" /><br />
Message:<br />
<textarea name="message" cols="25" rows="5"></textarea><br />
<input name="mail" type="submit" value="Email!" />
</form>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/64445-problem-with-script-or-ms-network/
Share on other sites

You have to have a mail server configured in php.ini, I think it's the SMTP directive.  There is no sendmail on windows, so the mail function doesn't just work like with unix.

 

If you control the windows server, you should be able to setup a mail host on that server...I'm not so sure about security and all that, as I'm not a windows admin.

 

You may also want to look into using something like phpMailer, or at least reusing some of their code so you can specify the mail server from your script.

 

http://www.php.net/mail#ini.smtp

ok, ill write my whole problem in one

 

 

 

 

I have the script in the first post, i have configured the smtp server (its on my host). The code will send to any address apart from microsoft ones like @msn.com, @hotmail.com etc... So, is this a problem with my script or a problem with the MS server?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.