Reputation: 259
I want to send mails using google smpt
with my angular 4 app
. I tried to send emails using email js. but I couldn't use it with my angular 4 app
. when I try to import, it says no any modules. how can I send mails using this existing library
or , is there any other way to send mails with angular 4 application
using google smpt
.
Upvotes: 1
Views: 21280
Reputation: 2102
Use npm emailjs package
Installing the package:
npm install emailjs
Upvotes: 1
Reputation: 1976
What you are trying to do won't work. You need a nodejs server-side app for that framework.
From emailjs
page you sent: send emails, html and attachments (files, streams and strings) from node.js to any smtp server
.
Try this service instead https://www.emailjs.com/docs/api-reference/installation/
<script type="text/javascript" src="https://cdn.emailjs.com/dist/email.min.js"></script>
<script type="text/javascript">
(function(){
emailjs.init("YOUR USER ID");
})();
</script>
You need to create an account in their website and replace the "YOUR USER ID" with your personal ID of your account.
Upvotes: 5