RE: I need help
Camila PiƱeiro <[email protected]> Fri, 18 Oct 2002 15:57:07 -0500
| Newsgroups | gmane.comp.java.enhydra.support |
|---|---|
| Message-ID | <[email protected]> |
Thanks a lot for your response. Here is what I need help with.
I'm doing a web site that it's an enhydra application. I want to send an
email from the run method of one of my HttpPresentation classes. I tested
the function I use for it in a java application and it works perfectly. B=
ut
in my enhydra application, when it gets to one instruction of my function
(the one with the arrow, where an instance of the MimeMessage class is
created), the application stops without throwing an Exception or anything.
I'm using the javax.mail package for sending the email. I already added =
the
.jar (of javax.mail and javax.activation packages, this last one because =
I
read it's needed) on the classpath of my application config.mk file.
Here is the function :
private boolean EnviarMail(String pStMail,String pStMensaje,String
pStHost,String pStMailAdmin,String pStIntAddress){
try {
if ((pStMail.compareTo("")=3D=3D0) && (pStMailAdmin.compareTo("")=3D=3D=
0) )
return true;
Properties props =3D System.getProperties();
// Setup mail server
props.put("mail.smtp.host",pStHost);
// Get session
Session sesion =3D Session.getDefaultInstance(props, null);
// Define message
MimeMessage message =3D new MimeMessage(sesion); <--- HERE
message.setFrom(new InternetAddress(pStIntAddress));
if (pStMail.compareTo("")>0)
message.addRecipient(MimeMessage.RecipientType.TO,new
InternetAddress(pStMail));
if ( (pStMailAdmin.compareTo("")>0) && (!pStMail.equals(pStMailAdmin))=
)
message.addRecipient(MimeMessage.RecipientType.CC,new
InternetAddress(pStMailAdmin));
message.setSubject("aviso de nueva queja o sugerencia");
message.setText(pStMensaje);
// Send message
Transport.send(message);
} catch (Exception sqe) {
System.out.println(sqe.toString());
return false;
}//try
return true;
}
I hope you can help me.
Camila
ps I'm using Enhydra 3.1
----- Original Message -----
From: Enhydra Support <[email protected]>
To: Camila Pi=F1eiro <[email protected]>
Sent: Friday, October 18, 2002 2:01 PM
Subject: Re: Support: I need help
>
> Yes, there are mailing lists associated with each project hosted on
> Enhydra.org. Each mailing list, however, is SOLELY for the purpose of
> technical questions regarding Enhydra and associated projects. SPAM of
any
> kind is not tolerated.
>
> What in particular do you need help with?
>
> At 02:45 PM 10/18/2002 -0500, you wrote:
> >Do you have mailing lists? How can I be part of one?
> >I'll apreciate your response. I need help with something.
> >Thanks, Camila.