How to manually provide smtp information for Mailable
I am creating an app where users can save their smtp information and can then send emails through the app to their clients. Can i use Mailable class for it or what should i do to make it happen. Right now, Laravel uses global settings for all emails.
@bobbybouwmann Thank you, this gets me a step closer! One thing though... If the email is queued, how does it work then? Does it use smtp settings that were present during the time mail was sent to queue or smtp settings that are present when the mail is actually sent?
One solution that i can think of is to create an Email model (i do need detailed email log anyway) and save all data needed to send an email including smtp settings from user to database. Then, i can make a queued job that gets email id and retrieves Email model object from database and just calls send method on it. That send method on Email model news mailable class, sets all needed attributes and uses Config::set() to update smtp information and then sends it.
@harran So, what you are saying is that if i set smtp config values inside a queue (inside mailable clas or job), the email will be sent using changed settings...
If that is true then now i have all the information i need to code it :) Not sure yet if i set config inside Mailable or Email model.