razor - asp.net error CS0103: The name 'WebMail' does not exist in the current context -
razor - asp.net error CS0103: The name 'WebMail' does not exist in the current context -
i have application simple contact form.
the view send email:
@{ seek { webmail.smtpserver = ""; webmail.smtpport = 587; webmail.username = ""; webmail.password = ""; webmail.from = ""; webmail.send("", "new contact", model.name + " <br> " + model.email + " <br> " + model.message); } grab (exception) { @:<div class="alert alert-danger">sorry! couldn't send email confirm rsvp.</div> } }
when fill form , send shows me error:
compiler error message: cs0103: name 'webmail' not exist in current context
how can prepare error?
i have same code in other project , works. i'm missing?
afzaal's reply close. code sample , tags create seem you're using razor view. add together namespace view utilize @using system.web.helpers
@ top of view.
or if you're going utilize on more 1 view, add together next web.config file within views folder under <namespaces>
tag:
<add namespace="system.web.helpers" />
asp.net-mvc razor
Comments
Post a Comment