title: Send mail from JSF page using beans
body: <p>i am creating a web application using jsf and primefaces, and my question is how to send an email through site's contact form (i've done this using php before, very easily, but never using jsf). I have created form on contact.xhtml page, as well as bean class to support that, and all that form should do is to send bean's data to a predefined mail (ie. gmail). I have also found several "tutorials" of how to send email using JavaMail, but nothing seems to work properly. The form itself, consists of name, email and message fields.</p>
  
  <p>Can someone write how to do that, or give me a link. I would be very gratefull.</p>
  
  <p>Do i need my site to be running on (online) server, or i can test it from localhost.</p>
  
  <p>Thank you in advance.</p>