<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: [opencms-dev] email question</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2745.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>You have to catch a
javax.mail.MessagingException.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=alexis@tsworld.com href="mailto:alexis@tsworld.com">Alexis
Torreno</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=opencms-dev@opencms.org
href="mailto:opencms-dev@opencms.org">The OpenCms mailing list</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, March 16, 2005 4:15
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [opencms-dev] email
question</DIV>
<DIV><BR></DIV>Hello Robert,<BR><BR>Thanks for the response. I wasn't very
clear about my syntax error, allow me to clarify:<BR><BR>I have this
snippet:<BR><BR>try{<BR> email.send();<BR>} catch (EmailException
e)<BR> [code goes in here]<BR>}<BR><BR>Now, when I run my JSP, I get a
compile-time error, because java doesn't like EmailException (i.e. cannot
resolve symbol).<BR><BR>Okay, should be easy to fix, maybe I just forgot to
import something? I am already importing org.opencms.mail.* and
org.apache.commons.mail.*.<BR><BR>Am I missing an import? Do I need an extra
jar file in my /lib folder? I'm sure it's something small<BR><BR>Al<BR><FONT
color=#0000ff><B><BR><BR></B></FONT><B>Alexis Torreno <BR></B>Web
Developer<BR><BR><B>TAYLOR|SPRULES CORPORATION<BR></B>Head Office<BR>66 The
Esplanade<BR>Toronto, ON M5E 1A6<BR><BR>Voice 416.362.4833 X 246<BR>Fax
416.362.5824<BR><FONT color=#0000ff><U>alexis@tsworld.com<BR></U></FONT><FONT
color=#ff0000>www.tsworld.com<BR></FONT><FONT
color=#808080><BR><B>TAYLOR|SPRULES CORPORATION <BR></B>We develop and
implement great ideas for<BR>intelligent corporations, individuals,
governments <BR>and NGO's around the world.<BR><BR><B>TAYLOR|SPRULES
CORPORATION<BR></B>Nous développons et lançons de grandes idées <BR>pour des
corporations, des particuliers, des gouvernements <BR>et des ONGs intelligents
à travers le monde.</FONT> <BR>
<BLOCKQUOTE><BR><B>From: </B>Robert Petermeier
<robert2.0@gmx.de><BR><B>Reply-To: </B>The OpenCms mailing list
<opencms-dev@opencms.org><BR><B>Date: </B>Tue, 15 Mar 2005 18:46:09
+0100<BR><B>To: </B>The OpenCms mailing list
<opencms-dev@opencms.org><BR><B>Subject: </B>Re: [opencms-dev] email
question<BR><BR></BLOCKQUOTE><BR>
<BLOCKQUOTE><TT>Alexis Torreno schrieb:<BR>> I want to be able to catch
an exception when using CmsSimpleMail, if the<BR>> email cannot be
sent.<BR>> <BR>> Has anyone done this?<BR><BR>Yes.<BR><BR>> I tried
using EmailException, from org.apache.commons.mail, but I get a<BR>>
syntax error when trying to run my JSP.<BR><BR>But you don't wanna tell
which error that is or post some code?<BR><BR>> <BR>> I'm new to
exceptions, and try/catch, any help is appreciated.<BR><BR>Well, using
commons email is pretty straightforward, so I suggest you
read<BR><http://java.sun.com/docs/books/tutorial/java/nutsandbolts/exception.html><BR><BR>The
only "pitfall" I can think of with commons email is that the<BR>addTo(),
addCc() and addBcc() methods take String objects as arguments<BR>while the
setTo(), setCc() and setBcc() methods take as argument a<BR>Collection of
not Strings but InternetAddress objects. And you need to<BR>specify the
email server in IIRC
opencms-system.xml.<BR><BR><BR>Regards,<BR>Robert<BR><BR><BR>_______________________________________________<BR>This
mail is send to you from the opencms-dev mailing list<BR>To change your list
options, or to unsubscribe from the list, please
visit<BR>http://mail.opencms.org/mailman/listinfo/opencms-dev<BR><BR><BR></TT></BLOCKQUOTE><TT><BR></TT>
<P>
<HR>
<P></P><BR><BR>_______________________________________________<BR>This mail is
send to you from the opencms-dev mailing list<BR>To change your list options,
or to unsubscribe from the list, please
visit<BR>http://mail.opencms.org/mailman/listinfo/opencms-dev</BLOCKQUOTE></BODY></HTML>