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


C# Email.sendEmail方法代码示例

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


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

示例1: pin

    private void pin()
    {
        Boolean printTicket = false;
        Boolean goBack = true;
        int amount = 0;
        String input;
        String dispenserCommand = "00,00,00,*";
        cancelled = false;

        while (goBack == true)
        {
            pinsherm.Show();
            while (true)
            {
                input = arduino.getString();
                if (input.Contains("1"))
                {
                    amount = 10;
                    break;
                }
                else if (input.Contains("2"))
                {
                    amount = 20;
                    break;
                }
                else if (input.Contains("3"))
                {
                    amount = 50;
                    break;
                }
                else if (input.Contains("4"))
                {
                    amount = getAlternativeAmount();
                    break;
                }
                else if (input.Contains("#"))
                {
                    cancelled = true;
                    break;
                }
                else if (input.Contains("C"))
                {
                    cancelled = true;
                    endOfSession = false;
                    break;
                }
            }
            pinsherm.Hide();
            if ((amount > saldo && amount != 0) || amount >= 200)
            {
                PinError pinError = new PinError();
                cancelled = true;
            }
            if (cancelled == true)
            {
                break;
            }
            if (amount == 10 && stock.checkIfAvailable(1, 0 , 0) == true)
            {
                dispenserCommand = "01,00,00,*";
            }
            else if(amount == 10)
            {
                BiljetScreen selector = new BiljetScreen();
                selector.showInsufficient();
                cancelled = true;
            }
            if (amount > 10)
            {
                dispenserCommand = biljetSelection(amount);
                if (dispenserCommand.Equals("00,00,00,*"))
                {
                    cancelled = true;
                    break;
                }
            }
            if (cancelled == true) { break; }
            uploadConnection.UpdateBalans(rekeningID, (saldo - amount*100));
            uploadConnection.transaction(pasID, rekeningID, amount);
            asker.Show();
            while (true)
            {
                input = arduino.getString();
                if (input.Contains("*"))
                {
                    printTicket = true;
                    goBack = false;
                    break;
                }
                else if (input.Contains("#"))
                {
                    goBack = false;
                    break;
                }
                else if (input.Contains("A"))
                {
                    Email mailer = new Email(userName, amount, rekeningID,klantID);
                    mailer.sendEmail();
                    goBack = false;
                    break;
//.........这里部分代码省略.........
开发者ID:CHG1731,项目名称:ATM,代码行数:101,代码来源:MainProgram.cs

示例2: btnForget_Click

    protected void btnForget_Click(object sender, EventArgs ev)
    {
        using (ModelTutor obj = new ModelTutor())
        {

            if (cbWho.SelectedValue == "1")
            {

                string email = txtEmail.Text.Trim();

                var result = (from e in obj.tblStudents
                              where e.Email == email
                              select e).Count();

                if (result == 1)
                {

                    // sent mail

                    Email m = new Email();

                    try
                    {
                        var pass = (from e in obj.tblStudents
                                    where e.Email == email
                                    select e.Password).First();

                        string body = "Your Email is : " + email + " and your password is : " + pass;

                        m.sendEmail(email, body);
                        Label1.Text = "Email has been sent to you.";
                        txtEmail.Text = "";
                    }
                    catch (Exception)
                    {

                        Label1.Text = "Email sending failed";
                    }

                }
                else
                    Label1.Text = "Enter valid email";

            }
            else
            {
                string email = txtEmail.Text.Trim();

                var result = (from e in obj.tblTutors
                              where e.Email == email
                              select e).Count();

                if (result == 1)
                {

                    Email m = new Email();

                    try
                    {
                        var pass = (from e in obj.tblTutors
                                    where e.Email == email
                                    select e.Password).First();

                        string body = "Your Email is : " + email + " and your password is : " + pass;

                        m.sendEmail(email, body);
                        Label1.Text = "Email has been sent to you.";
                        txtEmail.Text = "";
                    }
                    catch (Exception)
                    {

                        Label1.Text = "Email sending failed";
                    }

                }
                else
                    Label1.Text = "Enter valid email";

            }

        }
    }
开发者ID:jocosiol,项目名称:tutor_system,代码行数:83,代码来源:LostPassword.aspx.cs

示例3: btnRegister_Click

    protected void btnRegister_Click(object sender, EventArgs ev)
    {
        if (checkValidation())
        {
            using (ModelTutor obj = new ModelTutor())
            {

                string email = txtEmail.Text.Trim();

                var result = (from e in obj.tblTutors
                              where e.Email == email
                              select e).Count();

                if (result < 1)
                {
                    tblTutor newTutor = new tblTutor { Id = txtStudentId.Text.Trim(), Name = txtName.Text.Trim(), Email = txtEmail.Text.Trim(), Password = txtPassword.Text.Trim(), Active = true };
                    obj.AddTotblTutors(newTutor);

                    #region AddCourses

                    if (cbCourse1.SelectedValue != "0")
                    {

                        obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse1.SelectedValue), Grade = txtGrade1.Text.Trim(), Active = false });
                    }
                    if (cbCourse2.SelectedValue != "0")
                    {

                        obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse2.SelectedValue), Grade = txtGrade2.Text.Trim(), Active = false });
                    }
                    if (cbCourse3.SelectedValue != "0")
                    {

                        obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse3.SelectedValue), Grade = txtGrade3.Text.Trim(), Active = false });
                    }
                    if (cbCourse4.SelectedValue != "0")
                    {

                        obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse4.SelectedValue), Grade = txtGrade4.Text.Trim(), Active = false });
                    }

                    #endregion

                    #region Schedule

                    string mon = cbMonStart.SelectedValue + "to" + cbMonEnd.SelectedValue;
                    string tue = cbTueStart.SelectedValue + "to" + cbTueEnd.SelectedValue;
                    string wed = cbWedStart.SelectedValue + "to" + cbWedEnd.SelectedValue;
                    string thur = cbThurStart.SelectedValue + "to" + cbThurEnd.SelectedValue;
                    string fri = cbFriStart.SelectedValue + "to" + cbFriEnd.SelectedValue;

                    obj.AddTotblSchedules(new tblSchedule { TutorId = newTutor.TutorId, Mo = mon, Tu = tue, We = wed, Th = thur, Fr = fri });

                    #endregion

                    try
                    {
                        obj.SaveChanges();

                        Email m = new Email();

                        try
                        {
                            string body = "Hello " + txtName.Text.Trim() + ",\n" + "You are registered for Tutoring.";

                            m.sendEmail(email, body);
                        }
                        catch (Exception)
                        {

                        }

                        Response.Redirect("~/Sucess.aspx?m=Your account has been sucessfuly registered. Login to book tutor.");
                    }
                    catch (Exception)
                    {

                    }
                }
                else
                {
                    Label1.Text = "Email already exist";
                }

            }
        }
    }
开发者ID:jocosiol,项目名称:tutor_system,代码行数:87,代码来源:TutorRegistration.aspx.cs


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