简体   繁体   中英

Linking Angular form and getting form values via email

I'm new to Angular and never hosted a website. I have a contact form and obviously need the inputs to my email when the form gets submitted. How can I go about this

Pragmatic / simple solution

Probably not what you expected, but the simplest solution is a mailto link. What it will do is it will start the user's email with a new email, and the to field filled in with the address you want. You might be even able to prefill the subject and body, see https://css-tricks.com/snippets/html/mailto-links/ or search for mailto link .

Complete solution

The angular app runs in the browser. The browser can't send mails. You need to have a backend, and a REST endpoint in it, where your angular app can post the contents of the contact form. The backend then can send an email with the contents of the contact form via any kind of email service, or your backend might have an email service (most probably it doesn't).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM