PDA

View Full Version : Temporarily disable email


yellow_spider
01-29-2012, 04:55 PM
Is there a way to temporarily disable all outgoing mail ?

I am aware of the log to file but will it still attempt to send mail with that set up ? :confused: , I do need that as I want to check the mails being sent correctly etc, without actually sending it.

XF and IPB both have a config variable you can set to prevent outbound mail going (just logs to a file instead) for testing / debug purposes. Does VB4 have anything similar ? , I guess I just need to add a line somewhere or enable something in a configuration file.

kh99
01-29-2012, 07:04 PM
You can define DISABLE_MAIL in config.php to have it logged to a file. Here's the comment from class_mail.php:

/**
* Send the mail.
* Note: If you define DISABLE_MAIL in config.php as:
* delimited email addresses - Only mail for the recipients will be sent
* <filename>.log - Mail will be logged to the given file if writable
* any other value - Mail will be disabled

If you run a mail test from the admincp, I believe (based on a look at the code) that it will be sent even if you've defined DISABLE_EMAIL.

yellow_spider
01-30-2012, 01:12 PM
Thank you. :) Just to clarify this is what you meant (in config.php) ?

$config['disable_mail'] = 1;

My testboard is at 3.8 so I guess its the same for 3.x and 4.x

kh99
01-30-2012, 01:14 PM
I think what it actually means is:

define('DISABLE_MAIL', 1);


Sorry, I should have included that in my post.

yellow_spider
01-30-2012, 01:28 PM
Thank you :)