Пример #1
0
        private async Task SendEmailAsync(User user)
        {
            Application.Current.Properties["CurrentToken"] = _currentToken = Ultilities.RandomNumber(6);
            StringBuilder sb = new StringBuilder();

            sb.AppendLine($"<p>Dear {user.Name}, <br/>");
            sb.AppendLine($"This is the token to verify your email: <b>{_currentToken}</b>. <br/>");
            sb.AppendLine("Please do follow instruction to active your email. <br/>");
            sb.AppendLine("Thank you. <br/>");
            sb.AppendLine("--------------------------------------- <br/>");
            sb.AppendLine("Best regards from Thunder Market. </p>");
            string messageBody = sb.ToString();

            if (await _helper.SendEmailAsync(_currentEmail, "Verification Account - Thunder Market", messageBody))
            {
                SendDisplayAlert("Notification", "An email sent to your inbox!");
                return;
            }
            SendDisplayAlert("Error", "We can't send email to your email address, click resend to try again!");
        }