Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have this Contact form in the footerish area of a websiteGetting error: Error loading MacroEngine script (file: EmailForm.cshtml)EmailForm.cshtml =
@inherits umbraco.MacroEngines.DynamicNodeContext
@using System.Web.Mvc.Html
@using ClientDependency.Core.Mvc
@using Umbraco.Web
@using Umbraco.Web.Models
@using Umbraco.Web.Controllers
@using System.Net.Mail
@if (IsPost) {
@* Detect Spam*@
if(Request["cc"] != "" || Request["comments"] != ""){
<h3>Spam detected</h3>
}else {
MailMessage mail = new MailMessage();
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
mail.Subject = Request["name"];
mail.IsBodyHtml = true;
@*Create mail body ... take all input names and input values*@
foreach(string name in Request.Form){
if(Request.Form[name] != Request.Form["cc"] || Request.Form[name] != Request.Form["comments"]){
mail.Body += @name.Replace("_", " ") + ": " + Request.Form[name] + "<br/>";
}else{}
}
mail.ReplyToList.Add(new MailAddress (Request["email"]));
@*SMTP start*@
SmtpClient smtp = new SmtpClient();
try
{
smtp.Send(mail);
catch
@*do nothing*@
<span class="hideForm"></span>
------------------------------------------------------------------------------------------------------------------------Anyone see anyhting wrong in the above code that could be causing this?Using Umbraco 7.1.0Thanks
Bump
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error loading MacroEngine script (file: EmailForm.cshtml)
I have this Contact form in the footerish area of a website
Getting error:
Error loading MacroEngine script (file: EmailForm.cshtml)
EmailForm.cshtml =
@inherits umbraco.MacroEngines.DynamicNodeContext
@using System.Web.Mvc.Html
@using ClientDependency.Core.Mvc
@using Umbraco.Web
@using Umbraco.Web.Models
@using Umbraco.Web.Controllers
@using System.Net.Mail
@if (IsPost) {
@* Detect Spam*@
if(Request["cc"] != "" || Request["comments"] != ""){
<h3>Spam detected</h3>
}else {
MailMessage mail = new MailMessage();
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
mail.Subject = Request["name"];
mail.IsBodyHtml = true;
@*Create mail body ... take all input names and input values*@
foreach(string name in Request.Form){
if(Request.Form[name] != Request.Form["cc"] || Request.Form[name] != Request.Form["comments"]){
mail.Body += @name.Replace("_", " ") + ": " + Request.Form[name] + "<br/>";
}else{}
}
mail.ReplyToList.Add(new MailAddress (Request["email"]));
@*SMTP start*@
SmtpClient smtp = new SmtpClient();
try
{
smtp.Send(mail);
}
catch
{
@*do nothing*@
}
<span class="hideForm"></span>
}
}
------------------------------------------------------------------------------------------------------------------------
Anyone see anyhting wrong in the above code that could be causing this?
Using Umbraco 7.1.0
Thanks
Bump
is working on a reply...