Also a good tool to test if there is something wrong with you SMTP settings is the tool called SMTP4dev, you can download the tool here. https://smtp4dev.codeplex.com
I used the link which you send me,
but I ran into some problems
As you can see
namespace CCUD.Controllers
{
public class ContactFormSurfaceController : SurfaceController
{
public ActionResult RenderContactForm()
{
return PartialView("ContactForm", new ContactFormViewModel());
}
}
}
Sending mails with contact form
Hi!
I want to send email through a contact formular
This is how it looks like in my web config file:
But I don't know how to make the razor or the function to send it.
I've tried something like this on a partial view macro:
But it doens't work.... Has anyone a better way to tackle this problem of mine? I would appreciate it very much
Thanks in advance
/Sharmarke
Hi Sharmarke,
If you have access to Umbraco TV, then I think what you need to do, is in this video.
https://umbraco.tv/videos/developer/fundamentals/surface-controllers/handling-posts/
Also a good tool to test if there is something wrong with you SMTP settings is the tool called SMTP4dev, you can download the tool here. https://smtp4dev.codeplex.com
Hope this helps,
/Dennis
Hi Dennis
I don't have acces to UmbracoTv - can you suggest something else?
Have you tried to send an email to a gmail or live/hotmail before?
/Sharmarke
Hi Sharmarke,
Maybe this blog post from Warren Buckley can help you a step further,
http://creativewebspecialist.co.uk/2013/07/22/umbraco-mvc-what-on-earth-is-a-surface-controller/
Hope this helps,
/Dennis
Hi Dennis,
I used the link which you send me, but I ran into some problems
As you can see
Here's my Controller,
Can you please help me with this,
Maybe I've overlooked something...
/Sharmarke
Hi Dennis,
I got it working!!! Is just that my Controller name was "ContactFormSurface" and not "ContactSurface"
And now I can send emails to a gmail account
Thanks a lot, again!
/Sharmarke
Hi Sharmarke
Ran into exactly this yesterday.
The second part of the Html.Action is the route, took me a long time to find that one!
So your class being ContactFormSurfaceController, you need ContactFormSurface, omitting the controller.
That should call the correct route for you.
The part where I am stuck is the first part which is the action in the controller, clearly yours is RenderContactForm, so you should get the result.
Hope it helps
Gary
Hi Gary,
I figure it out, after I send my post reply to Dennis, lol!
But thanks anyway!
/Sharmarke
is working on a reply...