dcsimg
Parse email address entered by a human on a web form.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Travis_Polland
Posted On:   Friday, June 15, 2001 01:31 PM

Hi, I am new to JavaMail and Java and do not completely understand arrays, so I am looking for some Guru to help. ;) I have a form with a TO text field that people will type in a list of email addresses seperated be commas. I want my next JSP page that uses JavaMail to process the email send the email to all the addresses listes in the TO field. Here is the code that I am trying to write. (Of course, it doesn't work) What am I do ing wrong? <----CODE-------------> InternetAddress[] address = { parse(request.getParameter("TO"))}; newMessage.setRecipient(Message.RecipientType.TO, address); <----CODE----   More>>

Hi,

I am new to JavaMail and Java and do not completely understand arrays, so I am looking for some Guru to help. ;)



I have a form with a TO text field that people will type in a list of email addresses seperated be commas. I want my next JSP page that uses JavaMail to process the email send the email to all the addresses listes in the TO field.



Here is the code that I am trying to write. (Of course, it doesn't work)

What am I do ing wrong?



<----CODE------------->


InternetAddress[] address = {

parse(request.getParameter("TO"))};

newMessage.setRecipient(Message.RecipientType.TO, address);


<----CODE------------->



Thanks,


Travis



PS. I have gone through the FAQ and Forums and to get close to the answer, but not close enough.

   <<Less

Re: Parse email address entered by a human on a web form.

Posted By:   Travis_Polland  
Posted On:   Friday, June 15, 2001 01:49 PM

As a note: this doesn't work as well...


newMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(Address[] request.getParameter("TO")));

About | Sitemap | Contact