Closed amjadkhan closed 11 years ago
You can use GetSmtpClient
of your MvcMailMessage object and set custom properties from appSettings.
? The Populate(Action [MvcMailMessage] action) method on MailerBase returns an MvcMailMessage. How do I use GetSmtpClient to set smtp settings ? GetSmtpClient returns ISmtpClient which only has Send methods? Can you please provide an example of how to read and assign appSettings such as host, port, username and password. Thanks
Cast it to SmtpClientWrapper and use the innerSmtpClient property. Alternatively, create your own implementation of ISmtpClient and pass an instance of it to the Send method. Sorry, I can't share a code now.
Sent from my iPhone Sohan SM
On Sep 23, 2013, at 4:41 PM, Amjad Khan notifications@github.com wrote:
? The Populate(Action action) method on MailerBase returns an MvcMailMessage. How do I use GetSmtpClient to set smtp settings ? GetSmtpClient returns ISmtpClient which only has Send methods? Can you please provide an example of how to read and assign appSettings such as host, port, username and password. Thanks
— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/112#issuecomment-24961409 .
Is there anyway to get MVCMailer to read smtp settings from the appSettings section of the config file rather than the smtp node? My host only injects values into the appSettings section of the config file.