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
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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.