-1

enter image description hereI wrote a static website at pages.github.io. Since I did not have a server, I couldn’t realise data interaction, for example as with regard to users’ messages. Therefore, I was wondering if it were possible to use JavaScript to send users’ data through email and receive the other users’ emails, as a way to achieve data interaction.

wuchuheng
  • 13
  • 2
  • 3
    Possible duplicate of [Sending emails with Javascript](https://stackoverflow.com/questions/271171/sending-emails-with-javascript) – Sebastien D Mar 12 '18 at 08:54
  • Possible duplicate of [How to send an email from JavaScript](https://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript) – channasmcs Mar 12 '18 at 09:14
  • You may want to take a look at [EmailJS](https://www.emailjs.com/?src=so), which allows sending email using pre-built templates directly from Javascript [disclosure - I'm one of the creators] – Sasha Mar 12 '18 at 14:50

2 Answers2

1

you can use mailgun APIs that enable you to send, receive and track email effortlessly. https://smtpjs.com/

Email.send("from@you.com","to@them.com","This is a subject","this is the body","smtp.yourisp.com","username","password");
channasmcs
  • 1,104
  • 12
  • 27
0

Have a look at Sending emails with Javascript. Personally, I'd prefer some service to this solution, though. Checkout Formspree: https://formspree.io/ It seems to be made for this kind of thing and does not require any JavaScript.

If you need more control, https://aws.amazon.com/ses is Amazon's simple email service. Where you could send your message via an API. Mailgun (https://www.mailgun.com/) is similar and probably cheaper to add to your page.

thomi
  • 1,603
  • 1
  • 24
  • 31