A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Mail variables are not being resolved to a type !
Joined: Aug 21, 2008
Mar 03, 2009 14:53:34
I am trying to use the code below to send an email using
, but for all the variables i.e
its throwing exception that "cannot be resolve to a type " . I am using Eclipse and in build path it includes the classpath to mail.jar and activation.jar.
Here is the JSP code:
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
Properties props = new Properties();
Session s = Session.getInstance(props,null);
message = new
from = new
to = new
message.setSubject("Test from JavaMail.");
message.setText("Hello from JavaMail!");
A Message has been sent.
Check your inbox.
Click here to send another!
Author and ninkuma
Joined: Jan 10, 2002
Mar 03, 2009 14:54:36
Why on earth would you do this in a JSP? Move the Java code to a Java class where it belongs.
Asking smart questions
Books by Bear
I agree. Here's the link:
subject: Mail variables are not being resolved to a type !
Java Mail - How to send to Multiple recipients
Sending mail - Y! Mail - failed
Sending Mail JSP
javamail jsp problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014