File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Automatic mail sender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Automatic mail sender" Watch "Automatic mail sender" New topic

Automatic mail sender

Ranch Hand

Joined: Apr 01, 2005
Posts: 431
Hi All

I have a requirement like this. A java program should run always, which will check the dates from the database and based on the deadlines it should send mails with attachment(zip file) to appropriate email IDs.

Database part is pretty simple and I have coded them. Now I need to use Java mail API to send mails. But I never used it before.So can any one tell me about Java Mail API and how to send mails with attachments using it.

Also do I need to have any SMTP servers in my system?. If so, can anyone tell me some downloadable free SMTP servers which can be used for this purpose.

Advance thanks.

Gian Franco
Ranch Hand

Joined: Dec 16, 2003
Posts: 977

You don't need smtp servers on your system.

You could use any smtp server, for example
the one of your internet provider, for which
you should have a user name and a password.

You keep the details (user, password, delaytime,
etc.) regarding the mailserver in a properties
file. Open a session like this:

and start sending mails with the API's methods.

I have some additional info about sending attachments,
so if you'r interested send me a private post with
your e-mail adres.



"Eppur si muove!"
Ranch Hand

Joined: Apr 01, 2005
Posts: 431
Thanx dude

I have sent a private message to you with all the required details. Can you help me out?
I agree. Here's the link:
subject: Automatic mail sender
It's not a secret anymore!