当前位置: 首页>>代码示例>>C#>>正文


C# Email.SendNewRegistrationMail方法代码示例

本文整理汇总了C#中Email.SendNewRegistrationMail方法的典型用法代码示例。如果您正苦于以下问题:C# Email.SendNewRegistrationMail方法的具体用法?C# Email.SendNewRegistrationMail怎么用?C# Email.SendNewRegistrationMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Email的用法示例。


在下文中一共展示了Email.SendNewRegistrationMail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendLoginDetails

    private void SendLoginDetails(string email, string token)
    {
        Email o = new Email();
        StringBuilder messageTemplate = new StringBuilder();
        string Template = HttpContext.Current.Server.MapPath("~\\EMailTemplate\\") + "ResetPassword.txt";
        using (StreamReader rwOpenTemplate = new StreamReader(Template))
        {
            while (!rwOpenTemplate.EndOfStream)
            {
                messageTemplate.Append(rwOpenTemplate.ReadToEnd());
            }
        }

        StringBuilder resetURL = new StringBuilder();
        resetURL.Append("<a href='" + ConfigurationManager.AppSettings["ROOTURL"].ToString() + "/PasswordReset.aspx");
        resetURL.Append("?eml=" + Encrypt(email, ConfigurationManager.AppSettings["ENCKI"].ToString()));
        resetURL.Append("&token=" + Encrypt(token, ConfigurationManager.AppSettings["ENCKI"].ToString()));
        resetURL.Append("'>......../");
        resetURL.Append("&token=" + Encrypt(token, ConfigurationManager.AppSettings["ENCKI"].ToString()));
        resetURL.Append("</a>");
        messageTemplate.Replace("<!-#REGISTRATIONLINK#->", resetURL.ToString());
        o.SendNewRegistrationMail("Lost password request from AMAD Support Center", email, messageTemplate.ToString());
        MessageLabel.Text = "An email has been sent to reset your password. Kindly follow the instructions in you mail-box.";
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:24,代码来源:PasswordReset.aspx.cs

示例2: SendActivationEmail

    private void SendActivationEmail(string email, string token)
    {
        DataSet ds = Users.GetUserDetailsForActivation(email);
        Email o = new Email();
        StringBuilder messageTemplate = new StringBuilder();
        string Template = HttpContext.Current.Server.MapPath("~\\EMailTemplate\\") + "registration.txt";
        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                using (StreamReader rwOpenTemplate = new StreamReader(Template))
                {
                    while (!rwOpenTemplate.EndOfStream)
                    {
                        messageTemplate.Append(rwOpenTemplate.ReadToEnd());
                    }
                }

                StringBuilder resetURL = new StringBuilder();
                resetURL.Append("<a href='" + ConfigurationManager.AppSettings["ROOTURL"].ToString() + "/UserProfile.aspx");
                resetURL.Append("?eml=" + Encrypt(ds.Tables[0].Rows[0]["EmailAddress"].ToString(), ConfigurationManager.AppSettings["ENCKI"].ToString()));
                resetURL.Append("&mbl=" + Encrypt(ds.Tables[0].Rows[0]["MobileNumber"].ToString(), ConfigurationManager.AppSettings["ENCKI"].ToString()));
                resetURL.Append("&isp=" + Encrypt("No", ConfigurationManager.AppSettings["ENCKI"].ToString()));
                resetURL.Append("&fname=");
                resetURL.Append("&lname=");
                resetURL.Append("&token=" + Encrypt(token, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                resetURL.Append("'>......../");
                resetURL.Append("fname=");
                resetURL.Append("&lname=");
                resetURL.Append("&token=" + Encrypt(token, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                resetURL.Append("</a>");
                messageTemplate.Replace("<!-#REGISTRATIONLINK#->", resetURL.ToString());
                o.SendNewRegistrationMail("Thank you for registering with AMAD", ds.Tables[0].Rows[0]["EmailAddress"].ToString(), messageTemplate.ToString());
                MessageLabel.Text = "Thank you for choosing AMAD. Your profile is saved with us but is not activated. Kindly follow the instructions in you mail-box.";
            }
        }
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:37,代码来源:ResentPassword.aspx.cs

示例3: sendConfirmationEmail

    private void sendConfirmationEmail()
    {
        Email o = new Email();
        StringBuilder messageTemplate = new StringBuilder();
        string Template = HttpContext.Current.Server.MapPath("~\\EMailTemplate\\") + "NewRegistration.txt";
        using (StreamReader rwOpenTemplate = new StreamReader(Template))
        {
            while (!rwOpenTemplate.EndOfStream)
            {
                messageTemplate.Append(rwOpenTemplate.ReadToEnd());
            }
        }

        StringBuilder resetURL = new StringBuilder();
        StringBuilder mailDeatils = new StringBuilder();

        mailDeatils.Append("<b>Congratulations,</b> <b>" + FirstNameTextBox.Text + "</b><br/><br/>");
        mailDeatils.Append("<h3>Your account has been activated successfully. You can now enjoy your </h3><br/><li>personalized health care services</li><li>book an instant appointments with your favourite doctors</li><li>get your health related queries answered by our expert panel of doctors<li><li>and lots more...</li>");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to book an appointment with the Doctor");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to ask questions about your health and our expert panel of doctors will respond");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to know doctors nearest to you");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to read various health tips");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to know '<b>Dadi ke nuske</b>'");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to edit your profile");
        mailDeatils.Append("<br/><a href='#'>Click here</a> to change your password");
        mailDeatils.Append("<br/><br/><br/>If you have any concerns, please contact us at <a href='mailto:[email protected]'>[email protected]</a>");
        messageTemplate.Replace("<!-#MESSAGE1#->", mailDeatils.ToString());
        o.SendNewRegistrationMail("Your account has been activated with AMAD", EmailAddressTexBox.Text, messageTemplate.ToString());
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:29,代码来源:UserProfile.aspx.cs

示例4: RegisterNewUser_Click

    protected void RegisterNewUser_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            Email o = new Email();
            Users.IsPatient = Convert.ToBoolean(IsPatient.SelectedValue);
            Users.FirstName = FirstNameTextBox.Text;
            Users.LastName = LastNameTextBox.Text;
            Users.EmailAddress = EmailAddressTexBox.Text;
            Users.MobileNumber = MobileNumberTextBox.Text;
            Users.ActivationToken = GenerateRandomString();
            if (Users.checkUserAvailability() == "-1" || Users.checkUserAvailability() == "0")
            {
                string val = Users.RegisterUser();
                if (val == "" || val == "0")
                    RegisterLabel.Text = "Sorry! we could not register your records. Kindly try after some time. Sorry for the Incovenience";
                else
                {
                    StringBuilder messageTemplate = new StringBuilder();
                    string Template = HttpContext.Current.Server.MapPath("~\\EMailTemplate\\") + "registration.txt";
                    using (StreamReader rwOpenTemplate = new StreamReader(Template))
                    {
                        while (!rwOpenTemplate.EndOfStream)
                        {
                            messageTemplate.Append(rwOpenTemplate.ReadToEnd());
                        }
                    }

                    StringBuilder resetURL = new StringBuilder();
                    resetURL.Append("<a href='" + ConfigurationManager.AppSettings["ROOTURL"].ToString() + "/UserProfile.aspx");
                    resetURL.Append("?eml=" + Encrypt(EmailAddressTexBox.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&mbl=" + Encrypt(MobileNumberTextBox.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&isp=" + Encrypt(IsPatient.SelectedItem.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&fname=" + Encrypt(FirstNameTextBox.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&lname=" + Encrypt(LastNameTextBox.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&token=" + Encrypt(Users.ActivationToken, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("'>......../");
                    resetURL.Append("fname=" + Encrypt(FirstNameTextBox.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&lname=" + Encrypt(LastNameTextBox.Text, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("&token=" + Encrypt(Users.ActivationToken, ConfigurationManager.AppSettings["ENCKI"].ToString()));
                    resetURL.Append("</a>");
                    messageTemplate.Replace("<!-#REGISTRATIONLINK#->", resetURL.ToString());
                    o.SendNewRegistrationMail("Thank you for registering with AMAD", EmailAddressTexBox.Text, messageTemplate.ToString());
                    RegisterLabel.Text = "Thank you for choosing AMAD. Your profile is saved with us but is not activated. Kindly follow the instructions in you mail-box.";
                }

            }

        }
        catch(Exception ex)
        {
        }
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:53,代码来源:LoginRegister.aspx.cs


注:本文中的Email.SendNewRegistrationMail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。