• 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

MailSender Configuration  RSS feed

 
Ranch Hand
Posts: 1299
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?
 
Master Rancher
Posts: 1070
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: 1299
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
 
Nothing? Or something? Like this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!