PHPMailer with Exchange

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Ian W
Posts: 7
Joined: 19 Sep 2007, 14:02

PHPMailer with Exchange

Post by Ian W »

I've just setup Mantis on my Apache server, im trying to get the phpmailer function working with my exchange server but im not getting any good results, i've got the following lines in my config_inc.php file;
$g_administrator_email = 'myemail@myserver.co.uk;
$g_webmaster_email = 'admin@myserver.co..uk'; # the "From: " field in emails
$g_from_email = 'noreply@myserver.co.uk'; # the return address for bounced mail
$g_return_path_email = 'myemail@myserver.co.uk';
$g_enable_email_notification = On;
$g_validate_email = On;
$g_enable_email_notification = On;
$g_allow_signup = Off;
$g_send_reset_password = Off;
$g_phpMailer_method = 2;

$g_smtp_host = 'myserver.mydomain.local';
$g_smtp_username = 'my domain username';
$g_smtp_password = 'my domain password';
I've got my SMTP server defined in php.ini.

Is this right or have I got something wrong on the config? I'm not getting any error messages at all, im just getting a "SENDING FAILED" message, bit hard to troubleshoot !

Anyone got any tips?
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

This may be a silly question, but are you sure that your Exchange server is set up to accept SMTP requests and/or to be used as a gateway (or whatever it's called... sorry, bad coffee day)?
Ian W
Posts: 7
Joined: 19 Sep 2007, 14:02

Post by Ian W »

I think you may be right, I am now getting the following error
SYSTEM WARNING: fsockopen() [function.fsockopen]: unable to connect to myserver:25 (No connection could be made because the target machine actively refused it.)
Going to check the settings of my Exchange Server and try again :?
Ian W
Posts: 7
Joined: 19 Sep 2007, 14:02

Post by Ian W »

I've checked my Exchange, seems to be ok and should work.

From the machine that is running Mantis I can telnet to the Exhange server on port 25 and get a reply.

Can't see why the PHPMailer script is being rejected though ?
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

OK, so now I'm clutching at straws :)

I wonder if it's a user thing? Maybe if you are logged into the network the Exchange server is giving YOU access but when the web server is trying to access it (Apache, IIS or something else, by the way?) then the user running the server is not given access?

Again, just clutching at straws but I figured that I may as well suggest it.
Ian W
Posts: 7
Joined: 19 Sep 2007, 14:02

Post by Ian W »

I've got it working (kind of)

I can get Mantis to send mails now but once I include the line

$g_enable_email_notification = on;

in my config_inc.php then it stops working :(

Have you ever seen that happen before?
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

"then it stops working"

What is "it", exactly? Mantis entirely or just the sending of emails?

For what it's worth, that should be:
$g_enable_email_notification = ON;

anyway, as it's case-sensitive.
Ian W
Posts: 7
Joined: 19 Sep 2007, 14:02

Post by Ian W »

I meant the email stops working.

Thanks for tip about it being case sensitive, I changed that and its all working now :D

Thanks
Post Reply