Send Email using Exchange Server
Posted: Thu Oct 26, 2006 8:58 am
feyd | Please use
Any help would be greatly appreciated. TIA.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
At work we have a mail server, windows 2000 exchange Server to be specific. We have PHP 5.1.4 installed and running on IIS.
I want to send emails using mail server, but the code I have put together does not seem to work. when I run my script, I get no errors, but no emails come through to my mailbox either...
mailserver IP is 192.168.0.2Code: Select all
<?php
require('classes/class.phpmailer.php');
$mail->Sender = 'administrator@companyname.com';
ini_set('sendmail_from',$mail->Sender);
$mail = new PHPMailer();
$mail->AddAddress('sdelaney@companyname.com','mlennon@companyname.com');
$mail->From = 'administrator@companyname.com';
$mail->FromName = 'Pegasus Intranet Gate Keeper';
$mail->Subject = 'Just Testing the SMPT Settings for the Intranet';
$mail->ContentType = 'text/html';
$mail->CharSet = 'iso-8859-1';
$mail->Priority = 1;
$mail->Body = '<p>Hello, This email has been send using the Pegasus Exchange Server (192.168.0.2)</p>';
$mail->Send();
$mail->ClearAddresses();
$mail->SmtpClose();
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]