lewis987 Posted August 11, 2007 Share Posted August 11, 2007 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 More sharing options...
m1a2x3x7 Posted August 11, 2007 Share Posted August 11, 2007 make sure your ms host supports php Link to comment https://forums.phpfreaks.com/topic/64445-problem-with-script-or-ms-network/#findComment-321332 Share on other sites More sharing options...
lewis987 Posted August 12, 2007 Author Share Posted August 12, 2007 i mean it as in, is it because of microsofts servers or my script that it doesnt send to them? Link to comment https://forums.phpfreaks.com/topic/64445-problem-with-script-or-ms-network/#findComment-321577 Share on other sites More sharing options...
hitman6003 Posted August 12, 2007 Share Posted August 12, 2007 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 https://forums.phpfreaks.com/topic/64445-problem-with-script-or-ms-network/#findComment-321653 Share on other sites More sharing options...
lewis987 Posted August 12, 2007 Author Share Posted August 12, 2007 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 https://forums.phpfreaks.com/topic/64445-problem-with-script-or-ms-network/#findComment-321663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.