How do you make a automatic email form?
Hi, I have been trying to make a form that will send data to be via email. Does anyone know how to do this?
Ask coding questions
Hi, I have been trying to make a form that will send data to be via email. Does anyone know how to do this?
What language are you using? You will have to be using a backend language like
PHP
orDjango
with python - usingjavascript
you can't send mail.For PHP, check out the mail function.
For Django you can use send_mail.
You may be able to send mail with
Node.JS
, I'm not sure as I haven't used it.Please upvote if this helps :)
@ArchieMaclean
I’m probably using php. Can you help with that?
@ArchieMaclean Quick note - you can write backends with javascript. :) e.g. create a new express repl
@timmy_i_chen and @ArchieMaclean and @RohilPatel try using smpt.js it enables you to send mail via front-end javascript. No need for a back-end.
@TheDrone7
But I don’t want personal info online
@RohilPatel yes, good point. PHP on repl doesn't work very well (normally you can put
html
tags within the PHP file, but that doesn't work). I would recommend timmmy chen's method or Django - however, these both would require you to learn how to use that backend.@RohilPatel I don't see how you'll be leaking your personal info online using that. I've used it myself quite a lot, it's safe. Although it's only recommended if you don't want to get started with backend using node.js or python.
@TheDrone7 So long as you use the SecureToken.
@ArchieMaclean indeed.
Ok. I will try it @TheDrone7 @ArchieMaclean
@TheDrone7
Alright, can you explain how you do it then?
@RohilPatel Just visit their website, it has all the instructions you will need there - https://www.smtpjs.com/ . Unfortunately being on phone I cannot do much else.
@TheDrone7
Does repl have a smug server?
@RohilPatel I'm not sure what you mean by that.
@RohilPatel Do you mean an smtp server? No.
You'll need to set up one, I recommend SendGrid because it's free. It's fairly self explanatory; sign up then start an smtp relay. (Not api)
@ArchieMaclean
Ok. So I will check it out. And yes, I meant smpt server
@ArchieMaclean
So I got to the step where it wants me to “Configure your application with the settings below.” How do you do this?
@RohilPatel you need to set up your email thing with the settings - host name (see the smtp page)
@ArchieMaclean
I still don’t get it
@RohilPatel Do you hace a SecureToken? like this:
@ArchieMaclean or this:
@RohilPatel just set a variable like
var SecureToken=
then your secure token.