Exemple #1
0
        public async Task <ActionResult> Send(MyMessage myEvent)
        {
            myEvent.FromName         = User.Identity.Name;
            myEvent.FromEmailAddress = User.Identity.Name;

            await _repo.SendMessage(myEvent);

            return(Redirect("/Mail"));
        }
    public async Task<ActionResult> Send(MyMessage myMessage) {

      if (Request.HttpMethod == "POST") {
        MyMessagesRespository repo = new MyMessagesRespository();
        await repo.SendMessage(myMessage);
        return Redirect("/Mail");
      } else {
        return View(myMessage);
      }
    }
        public async Task <ActionResult> Send(MyMessage myMessage)
        {
            if (Request.HttpMethod == "POST")
            {
                MyMessagesRespository repo = new MyMessagesRespository();
                await repo.SendMessage(myMessage);

                return(Redirect("/Mail"));
            }
            else
            {
                return(View(myMessage));
            }
        }
        public async Task <ActionResult> Send(ExchangeClientDemo.Models.MyMessage myMessage)
        {
            if (Request.HttpMethod == "POST")
            {
                MyMessagesRespository repo = new MyMessagesRespository();
                await repo.SendMessage(myMessage);

                return(Redirect("/Mail"));
            }
            else
            {
                string currentUserEmail = System.Web.HttpContext.Current.Session["currentUserEmail"].ToString();
                myMessage.From         = currentUserEmail;
                myMessage.ToRecipients = new List <string>()
                {
                    currentUserEmail
                };
                return(View(myMessage));
            }
        }