• Index
  •  » PHP
  •  » Using mail() function in an intranet

#1 2006-08-14 04:43:03

stufow
New member
Ranking
Registered: 2006-08-14
Posts: 9
Expertise

Using mail() function in an intranet

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 :

Code::

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

 

#2 2006-08-18 17:48:49

Tabs
Banned
RankingRanking
Registered: 2006-08-18
Posts: 27
Website  Expertise

Re: Using mail() function in an intranet

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@remove-this.mydomain.com

Offline

 
  • Index
  •  » PHP
  •  » Using mail() function in an intranet

Board footer

OPML feedsRSS feeds



Powered by WWWThreads Forum
© Copyright 2006, WWWThreads