public EmailResult Invitation(InvitationToken token) { String currentDomain = Request.Url.Host.ToLower(); if (Request.Url.Port != 80) { currentDomain = currentDomain + ":" + Request.Url.Port; } // Setting up needed properties MailAttributes.From = new MailAddress("*****@*****.**", "Kawal Desa"); MailAttributes.To.Add(new MailAddress(token.User.Email)); MailAttributes.Subject = "Undangan bergabung dengan kawaldesa"; MailAttributes.Priority = MailPriority.High; //Calling the view which form the email body var invitation = new Invitation { Token = token, CurrentDomain = currentDomain }; return(Email("Invitation", invitation)); }