Can't send email to user

I want to send email to user as soon as data is loaded in certain form, for this reason i use this java code:
public class SendMails implements JavaDelegate{

	public void execute(DelegateExecution execution) throws Exception {
		
	
	final String FROM = "camunda@gmail.com";
   final String FROMNAME = "titan";

    final String TO = "titan@gmail.com";
    

    final String SMTP_USERNAME = "salome";
    

    final String SMTP_PASSWORD = "12345678";

     final String CONFIGSET = "ConfigSet";
  
     final String HOST = "smtp.gmail.com";
    
  
     final int PORT = 587;
    
    final String SUBJECT = "camunda:Adjust Form";
    
     final String BODY = String.join(
    	    System.getProperty("line.separator"),
    	    "<h1>Please Adjust form</h1>",
    	    "<p>This email was sent from Camunda ", 
    	    " for <a href='https://www.java.com'>"+"Please Adjust Form  with Name Apply?"+"</a>."
    	);

   

    	Properties props = System.getProperties();
    	props.put("mail.transport.protocol", "smtp");
    	props.put("mail.smtp.port", PORT); 
    	props.put("mail.smtp.starttls.enable", "true");
    	props.put("mail.smtp.auth", "true");

        // Create a Session object to represent a mail session with the specified properties. 
    	Session session = Session.getDefaultInstance(props);

        // Create a message with the specified information. 
        MimeMessage msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(FROM,FROMNAME));
        msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO));
        msg.setSubject(SUBJECT);
        msg.setContent(BODY,"text/html");
        
        // Add a configuration set header. Comment or delete the 
        // next line if you are not using a configuration set
        msg.setHeader("X-SES-CONFIGURATION-SET", CONFIGSET);
            
        // Create a transport.
        Transport transport = session.getTransport();
                    
        // Send the message.
        try
        {
            System.out.println("Sending...");
            
            // Connect to Amazon SES using the SMTP username and password you specified above.
            transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD);
        	
            // Send the email.
            transport.sendMessage(msg, msg.getAllRecipients());
            System.out.println("Email sent!");
        }
        catch (Exception ex) {
            System.out.println("The email was not sent.");
            System.out.println("Error message: " + ex.getMessage());
        }
        finally
        {
            // Close and terminate the connection.
            transport.close();
        }
    
	}

AND THEN I USE THIS CLASS IN SERVISE TASK, BUT WHEN FORM IS LOADED EMAIL ISN’T SEND TO CERTAIN USER WHAT SHOULD I CHANGE TO MAKE THIS IMLEMENTATION?

Hi Sally,
are you getting any error message?
Lukas

Hi @lhofer87 i don’t have any errors , but i can;t receive mail either ( p.s i have turned on less secure app on my gmail as i know it can be helpful when you use database mail but
is there any external functionality which i should turn on or off for receiving cmaunda mail?)