Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gerben van Laar 12 posts 102 karma points
    May 12, 2018 @ 12:47
    Gerben van Laar
    0

    Contact form using MailGun?

    Dear readers,

    I've been searching for a while now on how to use MailGun with a contact form for my site. But I am not sure on how to do this.

    I was thinking that maybe I could make a model and a surface controller. And in that particular controller I could send the output via MailGun to the intended e-mailaddress. Can you please point me in the right direction on how to solve my problem? Or is it even possible? Or is there a better way?

    Thanks is advance.

    Gerben

    PS: if you wish to read the documentation supplied by MailGun, here you have the link https://documentation.mailgun.com/en/latest/quickstart-sending.html#send-with-smtp-or-api. Don't forget to select C# underneath the header

  • Søren Mastrup 122 posts 564 karma points c-trib
    May 12, 2018 @ 19:42
    Søren Mastrup
    0

    As you mention, you could use a surface controller and send the submitted data to mailgun using their api. I would recommend that you use RestSharp as they do in the examples. All you need to know about sending a simple message via mailgun is found in the link you have provided for Mailguns documentation.

    In the documentation, here on our, you can read more about submitting a form to a surface controller: https://our.umbraco.org/documentation/reference/templating/mvc/forms

    If you need a full example, please let me know.

Please Sign in or register to post replies

Write your reply to:

Draft