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 = "*****@*****.**"; var errorMessage = ""; DHMailResult errMsg = new DHMailResult(); errMsg.errMessage = errorMessage; string toApprover = "*****@*****.**"; 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); }
public void DataTest10() { DHMailResult target = new DHMailResult(); Assert.Inconclusive("TODO: Implement code to verify target"); }
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", " "); var senderName = "Des Harrold"; var customerEmail = "*****@*****.**"; var errorMessage = ""; DHMailResult errMsg = new DHMailResult(); errMsg.errMessage = errorMessage; errMsg.superV = customerEmail; try { // Send email WebMail.Send(to: customerEmail, subject: "Document link from " + senderName, body: "Link:------" + currentContainer + currentBlob ); } catch (Exception ex) { errorMessage = ex.Message; errMsg.errMessage = errorMessage; } return View(); }
public void DataTest13() { DHMailResult target = new DHMailResult(); // TODO: Initialize to an appropriate value string expected = string.Empty; // TODO: Initialize to an appropriate value string actual; target.superV = expected; actual = target.superV; Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }