예제 #1
0
    private void SendEmail()
    {
        try
        {
            BINROTA.BUS.Mail myMail = new BINROTA.BUS.Mail();
            myMail.From = new MailAddress(txtEmail.Text, txtFullName.Text);
            myMail.AddToList(ConfigurationManager.AppSettings["SMTPToAddress"].ToString());


            string subject = "Binrota Ýletiþim";
            string msgBody = txtMessage.Text;

            myMail.SendEmail(subject, subject, msgBody);

            ltrEmailSuccess.Text    = "Ýletiþim mailiniz gönderilmiþtir";
            pnlForm.Visible         = false;
            pnlEmailSuccess.Visible = true;
        }
        catch (Exception)
        {
            ltrEmailSuccess.Text    = "Ýletiþim maili gönderilirken bir hata oluþmuþtur. Lütfen tekrar deneyin.";
            pnlForm.Visible         = false;
            pnlEmailSuccess.Visible = true;
            throw;
        }
    }
예제 #2
0
    private void SendActivationEMail(int MemberID)
    {
        BINROTA.BUS.Mail myMail = new BINROTA.BUS.Mail();
        myMail.AddToList(txtEmail.Text);

        string MailLink = "http://www.binrota.com/MemberActivation.aspx?ActivationKey=" + ActivationNumber + "&MemberID=" + MemberID.ToString();

        string subject = "Binrota aktivasyon maili";
        string msgBody = "<p>Binrota hesabýnýzý aþaðýdaki linke týklayarak aktive edebilirsiniz</p>"
                         + "<p>&nbsp</p>"
                         + "<a href=\"" + MailLink + "\">" + MailLink + "</a>";

        myMail.SendEmail(subject, subject, msgBody);
    }
예제 #3
0
    private void SendEmail()
    {
        try
        {
            //Enumerations.LoginType LoginType;
            //LoginType = ((Enumerations.LoginType)int.Parse(Request.QueryString["LoginType"].ToString()));
            DataTable dt = BINROTA.BUS.Members.GetPassword(txtEmail.Text);

            if (dt.Rows.Count > 0)
            {
                //MailMessage objMessage = new MailMessage();
                //string smtpServer = ConfigurationManager.AppSettings["SMTPServer"].ToString();
                //string smtpUser = ConfigurationManager.AppSettings["SMTPUserName"].ToString();
                //string smtpPass = ConfigurationManager.AppSettings["SMTPPassword"].ToString();
                //objMessage.From = new MailAddress(ConfigurationManager.AppSettings["SMTPUserName"].ToString(), ConfigurationManager.AppSettings["SMTPFromAddress"].ToString());
                //objMessage.Subject = subject;
                //objMessage.Body = msgBody;
                //objMessage.IsBodyHtml = true;
                //SmtpClient smtpClient = new SmtpClient(smtpServer);
                //smtpClient.Credentials = new System.Net.NetworkCredential(smtpUser, smtpPass);
                //smtpClient.Send(objMessage);

                BINROTA.BUS.Mail myMail = new BINROTA.BUS.Mail();

                myMail.AddToList(txtEmail.Text);

                string subject = "Binrota sifre hatirlatma";
                string msgBody = "<p>Sayin <b>" + dt.Rows[0]["FullName"].ToString() + "</b>,</p>"
                                 + "<p>&nbsp</p>"
                                 + "<p>Unutmus oldugunuz binrota sifreniz</p>" + CARETTA.COM.Encryption.Decrypt(dt.Rows[0]["Password"].ToString());

                myMail.SendEmail(subject, subject, msgBody);

                pnlForgotPassword.Visible = false;
                pnlEmailSuccess.Visible   = true;
            }
            else
            {
                pnlForgotPassword.Visible = false;
                pnlEmailError.Visible     = true;
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
예제 #4
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string msgHeader = "";

        try
        {
            BINROTA.BUS.Mail myMail = new BINROTA.BUS.Mail();
            myMail.AddToList(ConfigurationManager.AppSettings["SMTPToAddress"].ToString());

            string subject = SessRoot.NickName.ToString() + " adlý kullanýcýdan þikayet maili";

            DataTable dt = BINROTA.BUS.Pages.GetPageForExistanceControl(this.PageID);
            if (dt.Rows.Count > 0)
            {
                DataTable dtMember = BINROTA.BUS.Members.GetMemberDetailsByMemberID(System.Convert.ToInt32(dt.Rows[0]["MemberID"]));
                if (dtMember.Rows.Count > 0)
                {
                    //myMail.From = new MailAddress(dtMember.Rows[0]["Email"].ToString(), SessRoot.FullName);
                    msgHeader = msgHeader + "<p>";
                    msgHeader = msgHeader + dtMember.Rows[0]["NickName"].ToString() + " kullanýcýsýnýn ";
                    msgHeader = msgHeader + dt.Rows[0]["Title"].ToString() + " baþlýklý sayfasýndan þikayet maili";
                    msgHeader = msgHeader + "</p><br/><br/>";
                }
            }

            string msgBody = msgHeader + txtMessage.Text;

            myMail.SendEmail(subject, subject, msgBody);

            lbMessage.Text     = "Þikayet mailiniz gönderilmiþtir";
            pnlForm.Visible    = false;
            pnlMessage.Visible = true;
        }
        catch (Exception)
        {
            lbMessage.Text     = "Þikayet mailiniz gönderilirken bir hata oluþmuþtur. Lütfen tekrar deneyin.";
            pnlForm.Visible    = false;
            pnlMessage.Visible = true;
        }
    }