Tech Stuff

Sending Mail from a Java Application

I started striving for this from i guess, July 2007 and a mail got sent on 23rd May, 2008.  That day is still vivid in my memories, when my joy knew no bounds when i got my first JavaMail sent.

Sending Mail from a Java Application was my dream since i learnt a abit of Networking in JSP and some trivial concepts of Computer Networking.  I had started reading lots n lots of material available on the net, but i only used to get the program codes for it, there was no explanation given anywhere so as to what are the settings to be done on your machine to achieve the goal.

Suddenly one day, i came accross a site that had a bit of more information than others. It told me to add 2 .jar files to my classpath directory, viz. mail.jar, activation.jar ;

After adding these files, my code got running but now the question was what shall be the SMTP Protocol to be used and How???

I had decided to use my gmail account for the whole application, so i was in hunt of what is the name of the Mail Server that Gmail has. I got this easily because i had configured Outlook Express and there they need all these things to be configured. So i got the name of the Server that was going to serve my purpose and that was “” with the listening  port number as 465.

That was all that needed to be done to send a mail. And this took me almost 8 months to accomplish it, but it was an “Achievement” for me. When you keep on trying things for months, and later when you accomplissh them, obviously you are going to regard them as “Achievements”. All genious people reading this might think that just for a simple application, why did he take so long and why is he exaggerating it by calling it an Achievement and so on, but believe me people, working out small things was really difficult, which taught me PATIENCE and moreover it quenched my thirst of sending a mail.



  1. 1
    Gaurav Vaidya Says:

    Hey nice blog…!!Hope to see regular updates on it..:)

  2. 2
    anup Says:

    hay dat’s great blog!!!! it’s good to criticise u..update it regularly

RSS Feed for this entry

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: