From e50bd607b7f8e4047bf2a2c58fd31cf626aa198e Mon Sep 17 00:00:00 2001 From: HermesSbicego-Laser Date: Tue, 25 Oct 2016 09:18:24 +0200 Subject: [PATCH] - Formatted Code (Rebracer) --- .../Modules/Orchard.Email/Services/SmtpMessageChannel.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Email/Services/SmtpMessageChannel.cs b/src/Orchard.Web/Modules/Orchard.Email/Services/SmtpMessageChannel.cs index 02e26892a..bb2dc3c6f 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Services/SmtpMessageChannel.cs +++ b/src/Orchard.Web/Modules/Orchard.Email/Services/SmtpMessageChannel.cs @@ -108,7 +108,8 @@ namespace Orchard.Email.Services { if (!String.IsNullOrWhiteSpace(emailMessage.From)) { mailMessage.From = new MailAddress(emailMessage.From); - } else { + } + else { // Take 'From' address from site settings or web.config. mailMessage.From = !String.IsNullOrWhiteSpace(_smtpSettings.Address) ? new MailAddress(_smtpSettings.Address) @@ -124,12 +125,14 @@ namespace Orchard.Email.Services { foreach (var attachmentPath in emailMessage.Attachments) { if (File.Exists(attachmentPath)) { mailMessage.Attachments.Add(new Attachment(attachmentPath)); - } else { + } + else { throw new FileNotFoundException(T("One or more attachments not found.").Text); } } _smtpClientField.Value.Send(mailMessage); - } catch (Exception e) { + } + catch (Exception e) { Logger.Error(e, "Could not send email"); } }