Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Javascript alternative for JavaMail  RSS feed

 
Master Rancher
Posts: 933
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developping my own website.
In jave you can sent mails with the JavaMail API or javax.mail for that mather, is there an alternative for it in javascript or do I really need an ajaxscript to use a mailserver?
 
Daniel Demesmaecker
Master Rancher
Posts: 933
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lol never mind... I should update my googlefoo... I guess node.js' nodemailer would be the alternative?
 
Saloon Keeper
Posts: 5139
138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know about the mailer, but be aware that node.js runs on the server, not the browser.
 
Daniel Demesmaecker
Master Rancher
Posts: 933
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know, but that can be fixed with require.js
 
Sheriff
Posts: 23970
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're looking for a JavaScript-in-the-browser solution: I have to say my JavaScript skills are severely out of date, but it used to be that JavaScript in the browser wasn't allowed to connect to other servers. Security, you know. And to send an e-mail your code has to connect to an e-mail server. So I would expect your JavaScript code in the browser would have to use e.g. AJAX to have its server send the e-mail. Like I said, maybe the JavaScript revolution of the last decade has managed to deal with that restriction, and anybody who can prove me wrong, please jump in and do so.
 
Marshal
Posts: 67197
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:but it used to be that JavaScript in the browser wasn't allowed to connect to other servers.


That has been alleviated with CORS; but the server needs to buy into it. This allows cross-origin requests so remote APIs can used without a server-side proxy.

It does not allow server-side packages to be executed in the browser.
 
Daniel Demesmaecker
Master Rancher
Posts: 933
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suposendly that should also be resolved with require.js, High is a nom module, but honestly I couldn't make it work or at least after a few tries I moves on to something else. I now use email.js, which is not open source, but is still free under today's standards (you can sent 500 mails a months for free, which should be enough for a contactform) and is easy to use
 
Tim Moores
Saloon Keeper
Posts: 5139
138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Demesmaecker wrote:I know, but that can be fixed with require.js


Hadn't heard of that, but it seems to be some sort of JavaScript dependency and loading mechanism - how does that help with node.js being a server-side framework? Or is it a sort of bridging technology that seemlessly communicates between a JavaScript client and a JavaScript server?
 
Daniel Demesmaecker
Master Rancher
Posts: 933
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the typo's in my previous message. I'm on oh phone and didnt notice it got autocorrected. Yes... i think it simply lets you use their server.  It's not open source eather, but privately owned
 
Bear Bibeault
Marshal
Posts: 67197
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:but it seems to be some sort of JavaScript dependency and loading mechanism


That's exactly what it is. No less, no more. It's sort of old-fashioned these days being supplanted by ES6 exports, but is still extensively used in the Node.js environment. It started to catch on on the client side, but got nipped in the bud with ES6 support via Babel, Webpack and other client-side tooling.
 
She'll be back. I'm just gonna wait here. With this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!