Skip to content
← Back to Community
How do you make a automatic email form?
Profile icon
RohilPatel

Hi, I have been trying to make a form that will send data to be via email. Does anyone know how to do this?

Voters
Profile icon
SAMUROSAMURO
Profile icon
OathOfCode
Profile icon
SamWhite3
Profile icon
RohilPatel
Comments
hotnewtop
Profile icon
ArchieMaclean

What language are you using? You will have to be using a backend language like PHP or Django with python - using javascript 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 :)

Profile icon
RohilPatel

@ArchieMaclean
I’m probably using php. Can you help with that?

Profile icon
timmy_i_chen

@ArchieMaclean Quick note - you can write backends with javascript. :) e.g. create a new express repl

Profile icon
TheDrone7

@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.

Profile icon
RohilPatel

@TheDrone7

But I don’t want personal info online

Profile icon
ArchieMaclean

@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.

Profile icon
TheDrone7

@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.

Profile icon
ArchieMaclean

@TheDrone7 So long as you use the SecureToken.

Profile icon
TheDrone7
Profile icon
RohilPatel
Profile icon
RohilPatel

@TheDrone7

Alright, can you explain how you do it then?

Profile icon
TheDrone7

@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.

Profile icon
RohilPatel

@TheDrone7

Does repl have a smug server?

Profile icon
TheDrone7

@RohilPatel I'm not sure what you mean by that.

Profile icon
ArchieMaclean

@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)

Profile icon
RohilPatel

@ArchieMaclean
Ok. So I will check it out. And yes, I meant smpt server

Profile icon
RohilPatel

@ArchieMaclean

So I got to the step where it wants me to “Configure your application with the settings below.” How do you do this?

Profile icon
ArchieMaclean

@RohilPatel you need to set up your email thing with the settings - host name (see the smtp page)

Profile icon
RohilPatel

@ArchieMaclean
I still don’t get it

Profile icon
ArchieMaclean

@RohilPatel Do you hace a SecureToken? like this:

This file cannot be displayed: https://storage.googleapis.com/replit/images/1554296439999_4ae6f59bc3d92669f78eb8a00117d793.pn

Profile icon
ArchieMaclean

@ArchieMaclean or this:

This file cannot be displayed: https://storage.googleapis.com/replit/images/1554296480842_fc95c1a94476f0327ffec38739b663e3.pn

Profile icon
ArchieMaclean

@RohilPatel just set a variable like var SecureToken= then your secure token.

Profile icon
Gekot

Create notification templates if you would like to send users email reminder notifications for policy matches as part of the case resolution process, see here https://www.alert-software.com/mobile-apps . Notifications can only be sent to the user's email address associated with the specific case considered. When you select a notification template to apply to a policy match, you can accept the field values defined in the template, or rewrite the fields as needed.