public ActionResult DHMail(string uri)
{
Uri uriCurrent = new Uri(uri);
string currentStorage = uriCurrent.Segments[0];
string currentContainer = uriCurrent.Segments[1];
string currentBlob = uriCurrent.Segments[2];
currentBlob = currentBlob.Replace("%20", " ");
string from = "[email protected]";
var errorMessage = "";
DHMailResult errMsg = new DHMailResult();
errMsg.errMessage = errorMessage;
string toApprover = "[email protected]";
string server = "mail1.eircom.net";
errMsg.superV = toApprover;
MailMessage message = new MailMessage(from, toApprover);
message.Subject = "Document Link for Planning Review";
message.Body = "Document link details are as follows: " + currentStorage + currentContainer + currentBlob;
SmtpClient client = new SmtpClient(server);
// Credentials are necessary if the server requires the client
// to authenticate before it will send e-mail on the client's behalf.
client.UseDefaultCredentials = true;
try {
client.Send(message);
}
catch (Exception ex)
{
errorMessage = ex.Message;
errMsg.errMessage = errorMessage;
}
return View(errMsg);
}