Hi
I have built a flexi/leave system using PHP and MySQL which is running on a Windows 2003 server (IIS6) in an internal
internet. I have been asked to get the system to send emails to managers when certain parts have been completed by members of staff.
After a bit of digging about I found the mail() function. However all examples of code I have found are for external emails.
Any suggestions on how I would get this working in an intranet. We use MS Exchange 2003.
I did try a simple PHP script running on my PC that called the function :
<?php # Mail $mailaddress = 'stuart'; $subject = 'test'; $msg = 'This is a test'; mail($mailaddress,$subject,$msg); echo'<p>Mail Sent</p>'; ?>
It just complains about the SMTP :
Warning: mail(): Failed to connect to mailserver at "1itdeptxp" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in c:\inetpub\wwwroot\timesheet\pages\mail.php on line 7
What am I doing wrong? And is it possible to do this within an intranet?
Thanks
Offline
Well, it looks like your settings are wrong. You first need to have a mail server set up. Second, it is trying to connect to 1itdeptxp? A standard server is like pop.west.cox.net, port 25 is default, so that is probobly correct.
And the $mailaddress you entered isn't even a correct email address. It needs to be like stuart@mydomain.com
Offline