For Java, it's in 'javax.mail' and also 'javax.activation'. You can find API Doc for it for easy, try to go and search through
www.sun.com.
For C++, I dont know it has or not but you can do another way by Programming with Socket API, which actually it's used to send data between hosts but with specific Data Header.(Something like HTTP, such as => Content-Type: text/html\r\n) This make you go to look in rfc doc,
http://www.ietf.org.