Argh.....this is why I love PHP. I'm just having one roadblock after another with damn Java. But my job insists I use Java, so.....
Anyways....I'm using Javamail in my JSP, and get this error:
RecipientType.TO cannot be resolved to a type
Here's my code:
I know it's not complete, but I was adding lines 1 by 1 until I got that error, so I'm stuck there.
My import is:
and I have activation.jar and mail.jar in my WEB-INF\lib directory. I'm using Tomcat 5.5 on XP (ugh....wish I could bring my PowerBook to work. Damn "no computers except ours on the company network" policy).
thanks in advance
Anyways....I'm using Javamail in my JSP, and get this error:
RecipientType.TO cannot be resolved to a type
Here's my code:
Code:
Properties props = new Properties ();
props.put("mail.smtp.host", "smtp.----.com");
Session sendMailSession;
sendMailSession = Session.getInstance(props);
Message newMessage = new MimeMessage(sendMailSession);
newMessage.setSubject("----");
newMessage.setText("----");
InternetAddress from = new InternetAddress("----@----.com");
InternetAddress to = new InternetAddress("----@----.com");
newMessage.addRecipient(to, RecipientType.TO);
I know it's not complete, but I was adding lines 1 by 1 until I got that error, so I'm stuck there.
My import is:
Code:
<%@ page import="java.sql.*,javax.sql.*,java.io.*,javax.naming.*, Encrypt.*, java.util.*, javax.mail.*, javax.mail.internet.*, javax.activation.*" %>
and I have activation.jar and mail.jar in my WEB-INF\lib directory. I'm using Tomcat 5.5 on XP (ugh....wish I could bring my PowerBook to work. Damn "no computers except ours on the company network" policy).
thanks in advance