More in this section
Forums / Bugs & Issues / Form Builder with email

Form Builder with email

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Pavliks
    Pavliks avatar
    68 posts
    06 Apr 2010
    23 Mar 2012
    Link to this post
    Does this exist in Sitefinity 4.4? Nice to have forms but how come it can't send emails? Is there a control available in the market place? or an example how how to do this otherwise?
  2. Grace Hallwachs
    Grace Hallwachs avatar
    144 posts
    03 Nov 2014
    26 Mar 2012
    Link to this post
    Hello Nimit,

    Thank you for contacting support.

    There is tutorial plus sample project available in this blog post for forms e-mail notifications.

    For the subscribe form:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Net.Mail;
    using Telerik.Sitefinity.Configuration;
    using Telerik.Sitefinity.Services;
    using System.Text;
    using Telerik.Sitefinity.Web.Mail;
    using System.ComponentModel;
    namespace SitefinityWebApp
        public class Class1 : Telerik.Sitefinity.Modules.Newsletters.Web.UI.Public.SubscribeForm
            protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
                this.SubscribeButton.Click += new EventHandler(Class1_BeforeFormAction);
            private void Class1_BeforeFormAction(object sender, EventArgs e)
                var smtpSettings = Config.Get<SystemConfig>().SmtpSettings; 
                MailMessage message = new MailMessage();
                message.From = new MailAddress(smtpSettings.DefaultSenderEmailAddress);
                message.To.Add(new MailAddress(""));
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("You have one new form response on  form. The response is sent from IP address");
                message.Subject = "Forms notification";
                message.Body = sb.ToString();
                message.IsBodyHtml = true;
                message.BodyEncoding = Encoding.Unicode;
                message.SubjectEncoding = Encoding.Unicode;

    Create a class in your solution and create a custom subscribe form as in the sample above. Register the new control in Administration->Settings->Advanced->Toolboxes->PageControls->Sections->(choose section)->Create new and enter (namespace.class) of the class from the sample:
    Controll type: SitefinityWebApp.Class1 (in my case, I encourage you to create better naming)
    Name: Class1
    Title: Custom Subscribe Form

    To receive the e-mail you mut have valid SMTP settings configured in Administration->Settings->Advanced->System->SMTP.

    Please let us know if you have anymore questions.

    Grace Hallwachs
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered