add configuration as parameter for mail method