Which artifact for org.springframework.mail?

后端 未结 3 985
星月不相逢
星月不相逢 2021-01-31 06:50

I\'d like to use spring support for sending mails. My project is built with maven-2 and I use spring-core 2.5.5 I tried to look in maven central repo for artifact to include in

相关标签:
3条回答
  • 2021-01-31 07:13

    The mail stuff is found, rather bizarrely, in the context-support artifact.

    0 讨论(0)
  • 2021-01-31 07:26

    For using MailSender and SimpleMailMessage through Spring you can use these imports in your code:

    import org.springframework.mail.MailSender;
    import org.springframework.mail.SimpleMailMessage;
    

    And add their jars in your project.

    Otherwise if you are using maven then you have to make these imports in your source and then add dependencies :

    1. http://mvnrepository.com/artifact/org.springframework/spring-support/2.0.6
    2. http://mvnrepository.com/artifact/org.springframework/spring-context-support/3.2.0.RELEASE

    You will get the mail support from both of them.

    0 讨论(0)
  • 2021-01-31 07:38
     <!-- ########### SPRING-CONTEXT-SUPPORT ############ -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>3.0.5.RELEASE</version>
            </dependency>
    
    0 讨论(0)
提交回复
热议问题