I am working on user registration function.Now I headed a new problem.
I want to send an Email to user after user done with the Registration.
@PostMapping("registration")
public String registration(Model model,
@Valid @ModelAttribute("cool") User user,
BindingResult bindingresult) {
if (bindingresult.hasErrors()) {
model.addAttribute("cool", user);
return "registration";
}
model.addAttribute("user", user);
data.addUser(user);
//------------------------Email----------------//
// Here I need a solution
//------------------------Email----------------//
return "success";
}
For example:
my Email Address is: [email protected]
I want to send an Email from my Email(or from localhost) to User's Email.