# Creating a contact form with email notifications for new submissions

**URL:** <https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615>\
**Category:** Developers\
**Created:** [June 1, 2021, 11:34am UTC](https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615 "2021-06-01T11:34:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aiv](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/aiv/32/1275_2.png) [@aiv](https://forum.dfinity.org/u/aiv)\
**Post date:** [June 1, 2021, 11:34am UTC](https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615/1 "2021-06-01T11:34:26Z")

</div>

I’m creating a fairly simple website that needs to send emails to the site owner every time someone fills out the contact form.

Would it be possible to send email notifications while being able to host everything on the IC and without rigging up a wonky client side solution (basically just recreating a standard contact form experience on the IC)? What’s the best way to accomplish this?

@dpdp I found your ICQS Demo on Github, but wasn’t able to get it up and running on my end. However, it also looks like this would require the separate hosting of an oracle outside of the IC.

@anon74414410 I’m a fan! Would you be able to help?

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 3, 2021, 4:32pm UTC](https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615/2 "2021-06-03T16:32:38Z")

</div>

Currently we don’t have an IC way to send outgoing email from a canister. As for a contact form, you’d need to create a custom http\_request method to handle the incoming message from the form submission. Check out this thread for implementation details: [Question on http\_request()](https://forum.dfinity.org/t/question-on-http-request/2637)

---

<div class="post-metadata">

**Author:** ![aiv](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/aiv/32/1275_2.png) [@aiv](https://forum.dfinity.org/u/aiv)\
**Post date:** [June 4, 2021, 2:57pm UTC](https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615/3 "2021-06-04T14:57:14Z")

</div>

Hi Kyle,

Thanks for the reply!

I was able to get a working contact form that can send emails without an oracle. It uses a 3rd party service called EmailJS, which gives the ability to make an API call from the client side without exposing SMTP credentials. It’s not a perfect solution, but it’ll work for now and my client is happy with it!

To test that this would work in production, I deployed a quick and dirty demo you can feel free to play with here:  
[https://2hz3m-lyaaa-aaaad-qadvq-cai.ic.fleek.co/](https://2hz3m-lyaaa-aaaad-qadvq-cai.ic.fleek.co/)

My client and I are thinking of packaging this contact form solution into a resource for the Dfinity dev community so that other IC websites can have working contact forms. First I’d like to implement a way to store all form submissions in the backend canister so that the information can be recovered if any of the notification emails fail to reach the destination inbox.

Any thoughts or suggestions?

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 4, 2021, 3:26pm UTC](https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615/4 "2021-06-04T15:26:34Z")

</div>

Sounds like a pretty straightforward use case! You could either model the form in your canister, or you can use this example HashMap for JSON-encoded text that I used in one of my example projects!

> <https://github.com/krpeacock/ic-vcf-gatsby/blob/main/src/backend/phone_book/Main.mo>

---

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [September 3, 2021, 7:48am UTC](https://forum.dfinity.org/t/creating-a-contact-form-with-email-notifications-for-new-submissions/4615/5 "2021-09-03T07:48:17Z")

</div>

I made a proposal that would enable things like sending email but it still relies on a server running outside of the IC: [Megathread: Community Submissions for DFINITY Foundation’s Roadmap - #77 by paulyoung](https://forum.dfinity.org/t/megathread-community-submissions-for-dfinity-foundation-s-roadmap/6175/77)
