Comments (3)
Hi @ADarkDividedGem,
I much appreciated your gratitude. I would like to deserve more time to this project (e.g. I would like to migrate to Spring Boot 2.x), but I'm completely alone and due to other projects I can't afford everything alone at the moment.
Let's focus on the issue you are facing. I assume you use Spring Boot 1.5.x.
I have a few questions:
- Which OS are you running?
- If you run the app using the following code works?
import it.ozimov.springboot.mail.configuration.EnableEmailTools;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableEmailTools
public class BasicApplication {
public static void main (Stirng ... args) {
SpringApplication.run(BasicApplication.class, args);
}
}
- If you execute the following main works?
import it.ozimov.springboot.mail.configuration.EnableEmailTools;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableEmailTools
public class BasicApplication {
public static void main (Stirng ... args) {
SpringApplication application = new SpringApplication(BasicApplication.class);
application.run(args);
}
}
Finally, can you try something like
@Configuration
public class OSBasedApplicationInitializer implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
String profile = "production";
if(SystemUtils.IS_OS_WINDOWS){
profile = "development";
}
servletContext.setInitParameter("spring.profiles.active", profile);
}
}
from spring-boot-email-tools.
Thanks for the quick reply, after coming back to the problem with fresh eyes and thanks to your examples, a new perspective, I got it working.
Turns out there was nothing wrong with your code, instead it was just my misunderstanding of how profiles worked. After reading the documentation on Profile-specific Properties I assumed you needed to rename application.properties
to application-default.properties
for it to be recognised as the default properties file when adding additional profiles.
Once I renamed it back to application.properties
the defaults properties for spring.mail.
were loaded back in and the application ran fine.
Sorry for taking up your time, like you I am also working solo on my project so I appreciate all the help I can get.
from spring-boot-email-tools.
You can actually have one property file per profile or a single one that is multiprofile (and I think also a common properties and then those for the different profiles).
Glad everything works.
Best
R
from spring-boot-email-tools.
Related Issues (20)
- Callback on Schedule before sending a mail HOT 2
- When using boot maven without a parent HOT 4
- Dynamic modification configuration
- Thymeleaf template didn't work HOT 10
- how to run sending-mime-email-with-thymeleaf-example project HOT 2
- example did not run on spring-boot 1.3.5 HOT 1
- Not working well with Unit Test and Thymeleaf HOT 4
- Upgrade for Spring Boot 2.0 HOT 4
- Application upgradation HOT 12
- Use JedisClientConfiguration
- Add attachement to my email HOT 3
- spring boot azure storage and spring-boot-email-tools Failed to bind properties under 'azure.storage' to com.microsoft.azure.spring.autoconfigure.storage.StorageProperties: HOT 2
- Configuration failing with spring-boot-thymeleaf-email HOT 2
- Error creating bean with name 'defaultEmailService' HOT 5
- Make it possible to provide a locale to support i18n email templates
- Sending mail in batches
- Sometime email getting sent twice
- Add an option to skip SSL certificate validation when connecting to SSL-aware mail server
- form.label.identifier HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-email-tools.