• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Automatic mail sender

 
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.

Cheers,

Gian
 
S.L.Narayanan
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx dude

I have sent a private message to you with all the required details. Can you help me out?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic