Skip to main content
improved formatting
Source Link

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.

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----------------//
 
    //------------------------Email----------------//
    return "success";
}

my Email Address is: [email protected]

I want to send an Email from my Email(or from localhost) to User's Email.

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.

edited title
Link

Send How can I send email to user after Registration

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----------------//
     
        //------------------------Email----------------//
        return "success";
    }

my Email Address is: [email protected].[email protected]

I want to send an Email from my Email(or from localhost) to User's Email.

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----------------//
     
        //------------------------Email----------------//
        return "success";
    }

my Email Address is: [email protected].

I want to send an Email from my Email(or from localhost) to User's Email.

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----------------//
 
    //------------------------Email----------------//
    return "success";
}

my Email Address is: [email protected]

I want to send an Email from my Email(or from localhost) to User's Email.

Post Closed as "Needs details or clarity" by Drunix, greg-449, Mark Rotteveel
Source Link
Loading