• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send mail from jsf, can anybody tell me the a-z guide for this

 
raj nah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to use my gmail id as sender mail id to send mail to user who-ever visits on my website, how to do it.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the best way is to use JavaMail. If I'm not mistaken it's built into Java EE containers, such as the one you're using to contain your JSF code. Here's a link to the JavaMail FAQ, which specifically describes how to connect to Gmail.
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dude,

you can use below function for sending mail using JSF.

public String sendEmail(){
MailUtility mail=new MailUtility();
mail.sendMail("Subject", "Hi this is test mail", "sreekanthreddy.com@gmail.com");



return "success";
}
 
Brendan Healey
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

MailUtility is some in-house helper class someone has written? You both work for the same
company?
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no boss i am not i am working for tcs
it will work fine see the code if you want i will send you the Mailutility class
 
Brendan Healey
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It's just that I type MailUtility into NetBeans and nothing is coming up so it seems to not
be a standard package - so it's not going to be much help to anyone unless you can
provide further information about what it is, where to get it etc...

I've got e-mail sending working fine from with a Glassfish app server hooked into a
google mail account so I don't need any help myself.

Regards,
Brendan.
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK boss
if you need any help in jsf just reply me i will help you
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK great boss
i need detailed richfaces notes could you please help me in this
 
Vineet kumar Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting an error that..
Unknown smtp host ..when I am passing it the
smtp.gmail.com
 
Vineet kumar Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not in this way...
Write the full code and step step by step ...
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
https://www.coderanch.com/how-to/java/NotACodeMill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!