SendEmailToEmail() public static method

public static SendEmailToEmail ( string to, string subject, string message ) : bool
to string
subject string
message string
return bool
Example #1
0
        public static Thread email_NewUser_Welcome(this TMUser tmUser)
        {
            var email     = tmUser.EMail;
            var userName  = tmUser.UserName;
            var serverUrl = SendEmails.TM_Server_URL;

            if (email.notValid())
            {
                "[SendNewUserEmails] can't sent email because email value is not set".error();
            }
            else if (userName.notValid())
            {
                "[SendNewUserEmails] can't sent email because userName value is not set".error();
            }
            else if (serverUrl.notValid())
            {
                "[SendNewUserEmails] can't sent email because server Url value is not set".error();
            }
            else
            {
                var subject     = TMConsts.EMAIL_SUBJECT_NEW_USER_WELCOME;
                var fullName    = tmUser.fullName();
                var userMessage = TMConsts.EMAIL_BODY_NEW_USER_WELCOME.format(fullName, tmUser.UserName, serverUrl);
                return(SendEmails.SendEmailToEmail(email, subject, userMessage));
            }
            return(null);
        }