Meaningless Drivel is fun!*
The moose likes JSF and the fly likes Help with Send Email on submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Help with Send Email on submit" Watch "Help with Send Email on submit" New topic

Help with Send Email on submit

Fun Learning

Joined: Jun 25, 2008
Posts: 3
Hi Everyone,

I have a web page which has two selectone menus. They both are desgined to get populated with the same data, but the user has to select two different values for the two menus, and when he clicks submit, an email should be sent to both the values selected. For example, I have the following two menus.

<h:selectOneMenu id="advisorId" value="#{AdvisorChangeBean.advisorId}" onchange="this.form.submit()">
<f:selectItem itemLabel="Select your current advisor" itemValue="0" />
<f:selectItems value="#{AdvisorChangeBean.advisorslist}" />

<h:selectOneMenu id="advisorId1" value="#{AdvisorChangeBean.advisorId1}" onchange="this.form.submit()">
<f:selectItem itemLabel="Select your new advisor" itemValue="0" />
<f:selectItems value="#{AdvisorChangeBean.advisorslist}" />


I want to send an email to both advisorId and advisorId1 on clicking a submit button. I am using JSF along with Hibernate and Spring.

Can anyone please suggest me how to do this?

Thank you,
Joe Matthew
Ranch Hand

Joined: Jun 10, 2008
Posts: 66
I do not understand the question. Are you looking for a API to help you send a mail? If so, many APIs are available like JavaMail etc.

Regards,<br />Joe<br /> <br />"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."<br />--Martin Golding
Fun Learning

Joined: Jun 25, 2008
Posts: 3
No, am not looking for APIs. I was looking for help to send email to two different email ids based on the user selection in the two menus. The two menus have the same list of values, but the user has to select different values in the two menus. The drop down menus are getting populated from the database table which has column fields as id, firstname, lastname, email. An email should be sent to the email ids based upon the selection of values in the drop down menu. I was not able to do this. It would be great if anyone would suggest any idea to do this.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Help with Send Email on submit
Similar Threads
Value Change Listener
selectOneListbox error - choosing menyitems rapidly
Getting One Dropdown Menu Selection to Affect the Values of a Second Dropdown Menu
Problem with loading the data after Value Change Listener on selectonemenu
A Problem with events