I would recommend to use the BizFormItemEvents.Insert.After
event because it gets executed after the form is successfully inserted.
You can register event like: (see docs for more information)
BizFormItemEvents.Insert.After += Insert_After;
And then you can send out e-mail using the data from the inserted form like (the form is filtered as well using the ClassName which is unique to each form):
private void Insert_After(object sender, BizFormItemEventArgs e)
{
// filter only your particular form
if (e.Item.ClassName.Equals("bizform.yourFormClassName", StringComparison.OrdinalIgnoreCase))
{
// get data from form
var zip = e.Item.GetStringValue("ZipColumnName", "");
// do something with zip or any other field
// send e-mail using Kentico API
var email = new EmailMessage()
{
Recipients = "to@local",
From = "from@local",
Subject = "Subject",
Body = "Your Html e-mail",
PlainTextBody = "Plain text body"
};
EmailSender.SendEmail(email); // additionally you can use E-mail template so that you can edit the template in Kentico administration area
}
}