SMTP is the protocol for sending e-mail via a server, with or without attachments. IMAP and POP3 are protocols for retrieving e-mail from a server.
If you are working in a
J2EE container then JavaMail is already included and all you have to do is write code that uses JavaMail.