Cloud Stack Ninja

I understand this is a vague question, but I have a java/spring backend that sends email and I need to call it from my react frontend.

How should I call this service from my reactjs contact form?

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;

public class EmailUtilImpl implements EmailUtil{
    JavaMailSender sender;

    public boolean sendEmail(String toAddress, String subject, String body) {
        MimeMessage message = sender.createMimeMessage();
        MimeMessageHelper helper = new MimeMessageHelper(message);
        try {
        } catch (MessagingException e) {
            return false;
        return true;



Read more here:

Content Attribution

This content was originally published by tramada at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: