示例#1
0
    protected void btnCommand_Click(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            if (txtemail.Text == "")
            {
                msgBox1.alert("Kindly enter subject for your request!");
                txtemail.Focus();
                return;
            }

            //if (txtname.Text == "")
            //{
            //    msgBox1.alert("Kindly enter your name!");
            //    txtname.Focus();
            //    return;
            //}

            if (txtsubject.Text == "")
            {
                msgBox1.alert("Kindly enter subject for your request!");
                txtsubject.Focus();
                return;
            }

            if (txtmessage.Text == "")
            {
                msgBox1.alert("Kindly enter your message!");
                txtmessage.Focus();
                return;
            }
            MailToOffice curr = new MailToOffice();
            curr.Message = txtmessage.Text;
            curr.Subject = txtsubject.Text;
            //curr.Name = txtname.Text;
            curr.FromEmail = txtemail.Text;
            Util.SendMailToOffice(curr, ConfigurationManager.AppSettings["elizade"].ToString());
            ShowMessage("Request sent successfully!");
        }
    }
示例#2
0
    protected void BtnCommand_Click(object sender, EventArgs e)
    {
        if (txtemail.Text == "")
        {
            msgBox1.alert("Kindly enter your email!");
            txtemail.Focus();
            return;
        }

        if (txtname.Text == "")
        {
            msgBox1.alert("Kindly enter your name!");
            txtname.Focus();
            return;
        }

        //if (ddlcategory.SelectedValue == "-Select-")
        //{
        //    msgBox1.alert("Kindly enter category for yoour request!");
        //    ddlcategory.Focus();
        //    return;
        //}

        if (txtmessage.Text == "")
        {
            msgBox1.alert("Kindly enter your message!");
            txtmessage.Focus();
            return;
        }
        MailToOffice curr = new MailToOffice();
        curr.Message = txtmessage.Text;
        curr.Subject = ddlcategory.SelectedValue;
        curr.Name = txtname.Text;
        curr.FromEmail = txtemail.Text;
        Util.SendMailToOffice(curr, ConfigurationManager.AppSettings["HMOEmails"].ToString());
        ShowMessage("Request sent successfully!");
    }