Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/Laser.Orchard/feature/6196_Supp…
Browse files Browse the repository at this point in the history
…ortForAttachments' into 1.10.x
  • Loading branch information
HermesSbicego-Laser committed Oct 25, 2016
2 parents bf2201c + e50bd60 commit c1b1c4d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public void Process(IDictionary<string, object> parameters) {

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 void Process(IDictionary<string, object> parameters) {
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 c1b1c4d

Please sign in to comment.