How do I send emails in Java? - java

Hey. I currently want to develop a simple program in Java that sends out email. Not just a few emails, but actually a lot (10k+)
I have a subscribers list that all agree to it, by the way.
Anyway, I cannot send these emails via Gmail or anything like that - They do not allow that many emails to be sent. So the basic question is: How do I send emails by making the actual sending computer an email server?
I'm sure I should use some libraries, I heard about ChillKat or something like that.
Could anyone explain / help me out? Would be very much appreciated.

the library - commons-email, built ontop of the harder to use JavaMail
the servers
James - java based
Postfix - for unix/linux (howto)
many more - there are many smtp servers. Each requires some non-trivial configurations before you can use it in production. It is better to turn to an administrator for this.

James is a very powerful email server base on Java which with you can use the JavaMail API. Moreover James integrate the mailet API which is very usefull to improve the functionality of your mail server.
You can configure it to set the gateway on gmail easily changing the config file. (see this topic)
You can find a very good tuto here about James and mailet: Working with James

Related

Creating Server for a mobile multiplayer game

I have to build a server to which I make requests using Unity for a mobile game.
I was advised to stay away from using REST for the server.
I want to be able to, in the client, make GET and POST requests via endpoints like "/players".
My question here is: which programming language and programs do you recommend me to start with to build a server to which clients can communicate with, in this case?
I've been using NodeJS to write servers for my programs and I've found it really good for a couple of reasons:
1) It is easy to understand the syntax (JS) if you've been using UnityScript or C# in the past.
2) There is a free download from the Asset Store that helps you parse and send data from a NodeJS server.

how to build Spring BulkEmailer web application

I am new to spring.I had a doubt regarding sending mails.How can i send a bulk of mails from spring based web application in which i have a requirement in my project.
I have no idea on this please suggest me something which is helpful
Thanks in advance
you can send bulkemails using spring and it also offers scheduling a mails to multiple reciepts refer this example
refererence
You can also go through some of the real sites which are already exists and using for marketing with bulkmails check this
so that you can get an idea to work on your requirements
I usually offer some code but in this case I would just copy-paste from this tutorial.
Spring has very little in terms of mailing support (which is found in the context-support module), which itself is just a wrapper over the javax.mail package.
I would use a service like Amazon SES, which helps keep your email messages out of spam boxes.
Install an MTA (like Postfix) in Satellite Mode on your local machine. This will relay emails to Amazon SES.
Use JavaMail to send email messages to localhost, and they will go to your MTA queue, and get sent to Amazon.
Make sure you are complying with anti-spam legislation: http://www.business.ftc.gov/documents/bus61-can-spam-act-compliance-guide-business

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!

GAE For Java: Mail API

I have developed an application that sends out mails and SMS. My question is How to send well formatted mails using Google App Engine for Java, Please suggest me anyone.
Thanks,
Abhijit
You send the e-mails using GAE mail service, of course.
If you're asking about formatting, one way to do it is with a Velocity template. This will give you a nice mail merge feature as well: populate the template with values from a database and send out your messages.
in addition to duffymo's answer you could try freemarker or StringTemplate that are other well supported and well documented Java Templating Libraries.

Categories

Resources