Skip to content

Commit

Permalink
- Formatted Code (Rebracer)
Browse files Browse the repository at this point in the history
  • Loading branch information
HermesSbicego-Laser committed Oct 25, 2016
1 parent 580b79c commit e50bd60
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -108,7 +108,8 @@ public class SmtpMessageChannel : Component, ISmtpChannel, IDisposable {

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)
Expand All @@ -124,12 +125,14 @@ public class SmtpMessageChannel : Component, ISmtpChannel, IDisposable {
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");
}
}
Expand Down

0 comments on commit e50bd60

Please sign in to comment.