• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

MailSender Configuration  RSS feed

 
Ranch Hand
Posts: 1324
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a small application using Spring Boot, REST (SoapUI). The task is to send an email. At the moment the email is not sent and any error message appears in the Eclipse console. I am afraid that the session is not properly linked.



This is the relevant parts of the code on the component sending the email:
@Autowired
private MailSender mailSender;
message = new SimpleMailMessage();
mailSender.send(message);
I am using my local Tomcat, in the server.xml
In the applicationContext.xml of Spring I added the code


Any idea about how the config shuols be fixed or where the gap is please?
 
Rancher
Posts: 1170
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you on purpose leave  out your user and paswoord and changed the email to test@test.com?
Cause if that the actual confiig, that won't work?
You also need a valid host, your tomcat isn't a mailserver

for example put this in your application.properties:
 
Angus Ferguson
Ranch Hand
Posts: 1324
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it was a fake one.

Now it works this this code in the ApplicationContext.xml
 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!