A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Mail variables are not being resolved to a type !
Sending Mail JSP
Java Mail - How to send to Multiple recipients
javamail jsp problem
Sending mail - Y! Mail - failed
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014