Some config settings are sensitive, for instance email.transport.password. It would be better if you could configure them as a callback so you can read the value from a .env file.
I think you can set the password ($mailer->Password = 'secret';) with the beforeSend option just before sending the e-mail.
$mailer->Password = 'secret';
Interesting workaround, will keep this in mind thanks. Does not work for password reset emails though (if I’m correct).
@Philip Why doesn’t work for authentications?
@Philip Maybe this is the answer you’re looking for: The beforeSend callback can also be added as preset in config email option.
@Ahmet Bora Missed that part. Excellent, works perfectly!
@Philip Glad you figured it out. So I’m closing this idea?
@Ahmet Bora I can’t think of another config option that would benefit from this right now so go ahead. I’ll post a new idea if I encounter another case.