• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JavaMail API vs Spring-boot-starter-mail dependency?

 
Ranch Hand
Posts: 149
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I would like some clarification about JavaMali API and dependency in Spring Boot.

Story goes like this, our professor gave us a project to build an email messaging system, where the client would be Android app (which will communicate with back-end using Retrofit2 library) and back-end will be in Spring Boot with Hibernate. Here is the small part of UML, just to give you a better understanding about idea.

Also professor told us to use https://javaee.github.io/javamail/. I just downloaded the https://javaee.github.io/javamail/docs/JavaMail-1.6.pdf, I'm not sure if it is going to be useful in order to be able to use classes, interfaces and functionalities. Now, what I don't understand is, whether the JavaMali API is just jar/dependency with concrete classes to be used or Spring Boot's spring-boot-starter-mail provides us with implementation with JavaMali API? If I can make an analogy with JPA and Hibernate, JPA is a standard and Hibernateis just implementation of that standard? In simple words, if I add mentioned dependency, am I good to go?

One more thing, I really have no idea what are these five fields means: smtpAddress smtpPort inServerType inServerAddress inServerPort. I looked couple of YT tutorials but they only set (in application.properties) values for smtpPort and smtpAddress, like they are hard-coded. For example, in one of tutorials in application.properties, there is following code:



What if I want to register new User with yahoo email, or some other email, or to create new email, how to set above mentioned fields?  

How to (or should I) make them individual for each user? And in which way they interact with other fields?

P.S. I get that these are all questions for professor or TA's, but trust me they are as****s, and they will just tell you: manage it yourself...So I sincerely hope that here there are good people willing to at least give some foundation on top of which to build up. Thank you.  
UML.png
[Thumbnail for UML.png]
 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Gosling wrote:Also professor told us to use https://javaee.github.io/javamail/. I just downloaded the https://javaee.github.io/javamail/docs/JavaMail-1.6.pdf, I'm not sure if it is going to be useful in order to be able to use classes, interfaces and functionalities. Now, what I don't understand is, whether the JavaMali API is just jar/dependency with concrete classes to be used or Spring Boot's spring-boot-starter-mail provides us with implementation with JavaMali API? If I can make an analogy with JPA and Hibernate, JPA is a standard and Hibernateis just implementation of that standard? In simple words, if I add mentioned dependency, am I good to go?


Take a look at https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail/2.2.6.RELEASE. It shows the dependencies at the bottom. One of those is com.sun.mail:jakarta.mail. In the 2.1.13.RELEASE version that dependency was still com.sun.mail:javax.mail. That's because, as most (if not all) JEE components, JavaMail has been moved to Jakarta.

One more thing, I really have no idea what are these five fields means: smtpAddress smtpPort inServerType inServerAddress inServerPort.


The SMTP port and address are the port and hostname of the SMTP server. That's the part that will be sending your emails. I'm guessing that the others are for reading, and that the type can be POP3 or IMAP. However, that's just a guess, and you really need to ask your TA's, to at least give example settings, because this way it's really impossible to tell.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic