Send mail from my web application - java

I have a feature in my web app like I have to send mails from the server to many email ids (some kind of notification stuff)
my web application is implemented in struts2. Possibly I have to use javamail api i guess. I am completely new to this javamail and sending mail from server. what basic steps I need to do to setup a mail server in windows, contact the server from my java web app. What api i should I use ?
The web has very limited tutorials on javamail and they are damn complicated too.
Is there any other api other than javamail by which I can send mail from my java struts2 web app.
thanks

I suggest you use Mercury for your mail server. The javamail API is pretty straightforward. Just create a utility class to simplify the javamail API further.

for this use smtp in your jsp page...
for more refrence go to www.java2s.com

Related

Sending SMS via Java web applications

Have you seen how some companies send SMS in order to send access code etc? I am also in need of something like that. I have Java web application developed using JSP and Servlet. Through this application, I need to send SMS messages to some selected people.
I am open for free or paid APIs. But that API should support web based apps and should have the capability to send messages to Sri Lanka.
I went through lot of stuff like SMS Lib etc, but they are not built for web applications.
Any ideas?
You should see Simplewire Java SMS Software Development Kit
Sending and receiving SMS From Java using the Ozeki Java SMS SDK
You can have a look at OpenMarket Sms API. Its good and quite economical also.

How to send SMS using modem or gateway from java Web application?

I am new in java web application and I want to send SMS from my Java web application to mobile. How can i do this using mobile/modem or any other way? any easy java API?
i really appreciate ur help.
here is an api :
http://code.google.com/p/serial-comm/
i love this api over other is the reason that you dont have to worry about the native libraries and there path as this api automatically installs the desired native libraries to your system..
there are also other api/s like :
http://code.google.com/p/smslib/
i have recently developed an application using serial-comm which reads SMS from mobile/modem.
the other way around is to buy a sms gateway service like i use mvaayoo in that case you dont have to develop an application just use the api provided by the gateway vendor and that is just a http link to send SMS

Java Mail Server

I want to be able to send/receive mail from my Java Server application. Is there a standard tool chain to use? [The main thing is that I am writing an enterprise web app in Java, and I need a way to (1) send emails that contain authorization codes and (2) receive complaints.]
Thanks!
EDIT: I apologize. This is entirely my fault. I was not clear in the spec.
When I say send/receive emails, I meant: I need my application to be able to run it's own mail server. I don't have an external imap/pop3 account I'm using. My application need to provide the mail server.
The Apache James project might be a good starting point. It is a full-featured SMTP server written in Java. I am certain it is possible to interface other Java applications with James and/or write James extensions.
what you're looking for it's java mail and it's compatible with EE here's the link
Sending and receiving EMails you can do with the help of Java EE standard JavaMail API. If your application is spring enabled, you can use org.springframework.mail package which has some good abstraction utilities. Apart from this you need to have MTA(Mail Trasport Agent) like James as mentioned above.
Definitely a good alternative is Java E-mail Server (JES) at http://javaemailserver.sourceforge.net/. It's a full blown server for sending and receiving mail. "JES is a multi-featured hybrid MTA/MDA server written in the java programming language."

How can receive emails in Java based system preferably with spring?

I have looked up Google and Spring documentation but can not find any thing on receiving emails.
I need to build a client (kind of not fully blown client) that can receive emails from POP3 and IMAP. I am already using Spring in the project so preference is Spring.
Lots of links point to James but while it does look like a good project does not provide enough documentation and I am not even sure it does what I am after i.e just a small client that is able to to receive emails.
Spring integration was designed to solve these kind of problems. In particular it has e-mail receiving adapters. Here is an IMAP example from the documentation:
<mail:inbound-channel-adapter id="imapAdapter"
store-uri="imaps://[username]:[password]#imap.gmail.com/INBOX"
java-mail-properties="javaMailProperties"
channel="recieveChannel"
should-delete-messages="true"
should-mark-messages-as-read="true"
auto-startup="true">
<int:poller max-messages-per-poll="1" fixed-rate="5000"/>
</mail:inbound-channel-adapter>
POP3 and IMAP are not protocols that receive email. They go out and fetch it from a server.
The official JavaMail API
provides a platform-independent and protocol-independent framework to build mail and messaging applications.
Take a look!

Sending Mail using GWT Java in Dev mode

Can someone explain how to send mail in development mode from the gwt jetty
The mode does not matter. The mail is sent on the server-side. You can use commons-email to send emails from a servlet of yours. Check the user guide for a simple example. Note that you will need an SMTP server. For test purposes you can use your google account.
It's nothing about GWT because it runs on the server-side (pure java code) and you can use all the api that written in java. Have a look at java mail api

Categories

Resources