0

I want to know if it's possible to send an email through a form in the website and then we can check that email in the normal email service (like gmail, etc) and the wordpress' dashboard.

Thanks

1 Answer 1

1

Yes. You can use Contact Form 7 plugin to create a form that will send messages to your email (like gmail, etc) and use another plugin from the same author, Flamingo, to have those messages saved in WordPress database and available in the dashboard.

If you prefer to avoid plugins, here's what you need:

  1. Register non-public custom post type message to store submissions
  2. Create custom html for your form (probably with js validation)
  3. Intercept form submission on init hook
  4. Validate and secure input
  5. Create new post of message post type with wp_insert_post()
  6. Send email with wp_mail()
  7. Output results below the form (validation errors or success message)

As you see, plenty of work/code. If you're a developer, you should go this way to tailor it exactly for your needs. If not, I would strongly recommend you to use mentioned plugins (or any good alternatives) to avoid having some troubles with insecure form.

3
  • First of all thank you for you answer. I was trying not to use a plugin. Is there another way? Commented Nov 4, 2016 at 0:09
  • Of course. Let me update the answer. Commented Nov 4, 2016 at 0:14
  • Thank you for your answer, i will see whats the best approach for this project. Commented Nov 5, 2016 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.