flask-mail icon indicating copy to clipboard operation
flask-mail copied to clipboard

MAIL_DEFAULT_SENDER setting is required even when 'MAIL_SUPRESS_SEND = True'

Open djds23 opened this issue 10 years ago • 3 comments

djds23 avatar Apr 22 '15 01:04 djds23

This issue was made after configuring some test environments at NYCPython for PyGotham and it felt unnecessary to set 2 default settings in order for our create_admin command to work. After actually looking around the code, it feels like there are rarely places where this is the case. I think instead we should have just set SEND_REGISTER_EMAIL = False, since that is actually what we want. I am considering closing this issue

djds23 avatar Apr 22 '15 12:04 djds23

@djds23 keep in mind that there are other types of emails that are sent in the PyGotham application. Turning off one doesn't solve the problem, it just moves it.

@mattupstate without knowing more, my initial thinking was that MAIL_SUPPRESS_SEND would just bypass the send. I was surprised when it checked for MAIL_DEFAULT_SENDER. Is the idea of MAIL_SUPPRESS_SEND that it gets as close to sending the email as possible without actually sending it?

dirn avatar Apr 22 '15 14:04 dirn

@dirn Correct. The only thing MAIL_SUPPRESS_SEND prevents is connecting to the email server. Otherwise everything behaves the same. This is to create the least amount of side-effects as possible. Thus the error that @djds23 is reporting is to be expected.

mattupstate avatar Apr 22 '15 15:04 mattupstate

Suppressing sending isn't the same as not creating the message objects.

davidism avatar May 23 '24 15:05 davidism