package de.website.Bean;

import org.apache.commons.mail.*;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 * Created by Tobi on 29.02.2016.
 */
@ManagedBean(name="sendMail")
@RequestScoped
public class sendBean {

    public void mailSend(String name, String email, String subject, String text){
        
        String authuser = "...@gmail.com";
        String authpwd = "xxxx";

        Email simMail = new SimpleEmail();
        simMail.setHostName("smtp.googlemail.com");
        simMail.setSmtpPort(465);
        simMail.setAuthenticator(new DefaultAuthenticator(authuser, authpwd));
        simMail.setSSLOnConnect(true);

        try {
            simMail.setFrom(email);
            simMail.setSubject(subject);
            simMail.setMsg(text);
            //email.addTo("foo@bar.com");
            simMail.send();

        } catch (EmailException e){

        }
    }
}

@@ -241,16 +241,88 @@
 ndBean %7B
+%0A    %0A    final static Logger logger = Logger.getLogger(sendBean.class);
 %0A%0A    pu
@@ -962,16 +962,93 @@
 tion e)%7B
+%0A            %0A            logger.error(%22Fehler beim senden der E-Mail: %22, e);
 %0A%0A      

Update sendBean.java