This project is read-only.

Contact Bug

Topics: User Forum
Apr 29, 2010 at 6:59 PM

Is there a Bug in "Contact Form" ?

I am at the end, nothing works.

I get this message "File Not Found"

 

Sammy

Apr 30, 2010 at 8:41 AM

you have to change ContactForm.ascx.cs file in sectioncontrols folder : here is solution

 protected void btnSubmit_Click(object sender, EventArgs e)
 {
  if (Session["ContactFormSent"] == null)
  {
   Page.Validate(ID);
   if (Page.IsValid)
   {
    WebSite _website = WebSite.GetInstance();
    MailMessage mail;
    if (txtName.Text.Trim() != string.Empty)
    {
//     mail = new MailMessage(new MailAddress(txtEmailFrom.Text.Trim(), txtName.Text.Trim()), new MailAddress(_section.EmailTo, _section.EmailTo));

                    mail = new MailMessage(new MailAddress(_website.MailSenderAddress, _website.WebSiteTitle), new MailAddress(_section.EmailTo, _section.EmailTo));

                    //                    mail = new MailMessage(new MailAddress(txtEmailFrom.Text.Trim(),txtName.Text.Trim()), new MailAddress(_section.EmailTo,_section.EmailTo));

    }
    else
    {
     mail = new MailMessage(txtEmailFrom.Text.Trim(), _section.EmailTo);
    }

    if (_section.EmailCc.Trim() != string.Empty)
     mail.CC.Add(_section.EmailCc);
    mail.SubjectEncoding = Encoding.UTF8;
    mail.Subject = _section.Subject;
    mail.BodyEncoding = Encoding.UTF8;
    mail.IsBodyHtml = false;
    mail.Body = txtMessage.Text.Trim();
    SmtpClient client = new SmtpClient(_website.SmtpServer);

    //when Smtp user/password/domain is given, SMTP-Authentication has to be used
    if ((!string.IsNullOrEmpty(_website.SmtpUser)) && (!string.IsNullOrEmpty(_website.SmtpPassword)))
    {
     if (string.IsNullOrEmpty(_website.SmtpDomain))
     {
      client.UseDefaultCredentials = false;
      client.Credentials = new NetworkCredential(_website.SmtpUser, _website.SmtpPassword);
     }
     else
     {
      client.UseDefaultCredentials = false;
      client.Credentials = new NetworkCredential(_website.SmtpUser, _website.SmtpPassword, _website.SmtpDomain);
     }
    }

    client.Send(mail);

    Session["ContactFormSent"] = true;
   }
  }
 }

May 1, 2010 at 7:39 PM
Edited May 1, 2010 at 7:40 PM

I still get the "Page not Found message"

I t happens when I hit Send.

 

Sammy