Sending mail using java mail API

for this java mail api should be present on your class path.