Пример #1
0
    protected void btnregister_Click(object sender, EventArgs e)
    {
        try
        {

            string Name = GeneralFunc.ToProper(txtContcname.Text).Trim();
            string Phone = txtphone.Text;
            string Email = txtemail.Text;
            clsMailFormats format = new clsMailFormats();
            MailMessage msg = new MailMessage();
            msg.From = new MailAddress(CommonVariable.FromInfoMail);
            msg.To.Add(CommonVariable.ContactUsEMail);
            msg.CC.Add(CommonVariable.ContactUsEMailCC);
            msg.Bcc.Add(CommonVariable.ArchieveMail);
            msg.Subject = "Regarding Contact request";
            msg.IsBodyHtml = true;
            string text = string.Empty;
            text = format.SendContactRequestDetails(Name, Phone, Email, ref text);
            msg.Body = text.ToString();
            SmtpClient smtp = new SmtpClient();
            //smtp.Host = "smtp.gmail.com";
            //smtp.Port = 587;
            //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad");
            //smtp.EnableSsl = true;
            //smtp.Send(msg);
            smtp.Host = "127.0.0.1";
            smtp.Port = 25;
            smtp.Send(msg);

            mpealteruser.Show();
        }
        catch (Exception ex)
        {
        }
    }