JavaMail - sending a email to particular address everytime a form is submitted

Hi,

I am a trying to make some enchancements to my previous application. In this application we developed a form using jsp which contains few fields. Once a user fills this form and click the submit button an email should go to admin with a message ( record is submitted by the XYZ person). Please if any one could help me out in this issue , how to do it.

Many thanks in advance

Anbr19

[411 byte] By [anbr19a] at [2007-11-26 23:09:17]
# 1
[url= http://java.sun.com/products/javamail/]Javamail[/url]
bckrispia at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi,

I know i should use javamail but i am ot sure how to implement it bcoz in my project whenever a user sumbits a record , a meeasge should go to datamanager that a record is submitted by this user. And also one moret hing if a user submits simultaneously morethan 1 record at a time then only one message should go to datamanager by that user Please could you tell me elabrately how to do exactly. This is very urgent.

Thanks in Advance

Anbr19.

anbr19a at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
JavaMail will send the message for you, but you have to figure out whento send the message. Most of your problem seems to be about figuringout when to send a message, which is not a JavaMail problem.
bshannona at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
My requirement is when a form is submitted, a trigger (message" record is submitted to database") should go automatically to admin emailid. Please could you tell me how to do it.Thanks in advanceAnbr19
anbr19a at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
When the form is submitted, some servlet or JSP runs in your server, right? So put JavaMail code in that servlet or JSP to do whatever you want done.
DrClapa at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
Thanks Drclap but can i have any sample code. If so please reply some sample codes to anbr19@gmail.com.ThanksAnbr19
anbr19a at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7
Javamail comes with sample code. And it's good enough for what you want to do.
DrClapa at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 8
Thanks Drclap. I will try that
anbr19a at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 9
So put JavaMail code in thatservlet or JSP to do whatever you want done.JavaMail code in a JSP?!!Smithers! Release the hounds!!:P
bckrispia at 2007-7-10 14:04:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...