void EmailSend(int ID, string Message, string Subject) { string mail = cx.Users.FirstOrDefault(x => x.id == ID).mail; emailSending MailObject = new emailSending(mail); MailObject.SendProcedure(Message, Subject); }
public ActionResult Contribute(string mail) { try { emailSending emailObject = new emailSending("*****@*****.**"); string Message = "Wanna contribute to the project\n" + "My email is:" + mail; emailObject.SendProcedure(Message, "Contribution"); TempData["ContributionMessage"] = "the email has been shared with the admin, you will hear from as soon"; } catch { TempData["ContributionMessage"] = "Failed to share the email, Please try again later"; } return(RedirectToAction("Main")); }