Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
September 01, 2014, 01:10:17 PM

Pages: 1 [2]   Go Down
  Print  
Author Topic: JavaMail Example / Wrapper  (Read 41414 times)
Danielle
Guest
« Reply #15 on: August 27, 2005, 09:55:33 PM »

I have updated the war file location in both posts.  It is also in our FAQ on the Help Desk (the better location to get it as that updates when the url updates):

http://helpdesk.lunarpages.com/faq.php?do=article&articleid=114

Thanks.
Logged
tobias
Spacescooter Operator
*****
Offline Offline

Posts: 37


WWW
« Reply #16 on: September 20, 2005, 12:30:39 PM »

I am using the javamail example and am getting the following error message

webapps/members/WEB-INF/classes/jdbc/MailBean.java:23:
Package javax.mail not found in import.
import javax.mail.*;
       ^
webapps/members/WEB-INF/classes/jdbc/MailBean.java:24:
Package javax.mail.internet not found in import.
import javax.mail.internet.*;
       ^
webapps/members/WEB-INF/classes/jdbc/MailBean.java:25:
Package javax.activation not found in import.
import javax.activation.*;

but the import statements are present in the bean...

can anyone help me with this??

many thanks
Logged
moilejter
Intergalactic Cowboy
*****
Offline Offline

Posts: 69


WWW
« Reply #17 on: September 24, 2005, 07:21:47 AM »

You have to download the JavaMail and Java Activation Framework APIs and install the corresponding jar files (mail.jar and activation.jar?) to your WEB-INF/lib folder...

Moises
Logged
tobias
Spacescooter Operator
*****
Offline Offline

Posts: 37


WWW
« Reply #18 on: September 28, 2005, 06:46:08 AM »

thanks for that moises, i've put both the activation.jar and mail.jar in the lib folder of WEB_INF but now i am gettin this message:

Undefined variable, class, or package name: javax
          mimemessage.setRecipients(javax.mail.Message$RecipientType.TO, ainternetaddress);

anyone got any ideas?
thanks
Logged
Eidolon
Trekkie
**
Offline Offline

Posts: 18


WWW
« Reply #19 on: December 15, 2006, 05:38:35 AM »

Change that line to instead of having "Message$RecipientType.TO" to "Message.RecipientType.TO".
Logged

Like paintings? Come see my gallery: www.razorsharpdesigns.com/~gallery
mabadrah
Newbie
*
Offline Offline

Posts: 1


« Reply #20 on: April 12, 2007, 01:03:59 AM »

I'm trying to download the wrapper froom "http://lunarwarriors.com/jsp/Mail.war" but it needs authentication!!!
I tried my fourms' login name and my lunar pages' account as well, but they didn't work.

How should I get this wraper and example code?!!

Thanks in advance
Logged
appts2
Newbie
*
Offline Offline

Posts: 4


« Reply #21 on: October 23, 2007, 04:01:18 PM »

Hey..I was hoping to use your mail.war file for a problem I'm having w/ sending mail.

But..when I try to download it..i'm prompted for a id/pswd.

Any thoughts..

thanks

Wm
Logged
appts2
Newbie
*
Offline Offline

Posts: 4


« Reply #22 on: October 23, 2007, 04:28:01 PM »

Kevin,
thanks for the note about the war file...but when i try to access..it prompts me for a lunarwarriors id/pwsd.

a. How wld I get one of these.
b. Cld you just send it to me @ wfkinnc@bellsouth.net

Thanks

Wm
Logged
onepavel
Newbie
*
Offline Offline

Posts: 2


« Reply #23 on: November 04, 2008, 05:04:03 PM »

Hello!

I use javamail, and cannot send mail =(
code:

Code:
    String host = "krypton.lunarpages.com";
    String user = "login_to_ftp";
    String password = "password_to_ftp";
   
    Properties props = System.getProperties();
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.auth", "true");
   
    Session mailSession = Session.getDefaultInstance(props, null);

    try {   
      MimeMessage msg = new MimeMessage(mailSession);
   
      msg.addRecipient(Message.RecipientType.TO, new InternetAddress("onepavel@yandex.ru"));
      msg.setFrom(new InternetAddress("newsletter@iconsoft.com"));
      msg.setSubject("Test");
      msg.setText("Hi");

      Transport transport = null;
      transport = mailSession.getTransport("smtp");
      transport.connect(host, user, password);
      transport.send(msg);

    }
    catch (Exception e)  {
       PrintWriter writer = new PrintWriter(out);
       e.printStackTrace(writer);
    }
    finally {
        if (transport != null) {
            try { transport.close(); }
             catch (MessagingException e) {}
        }
    }

I receive result:
  javax.mail.AuthenticationFailedException at javax.mail.Service.connect(Service.java:319)
  at javax.mail.Service.connect(Service.java:169)
  at javax.mail.Service.connect(Service.java:118)
  at javax.mail.Transport.send0(Transport.java:188)
  at javax.mail.Transport.send(Transport.java:118)
  at _jsp._sender__jsp._jspService(_sender__jsp.java:65)
  at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
  at com.caucho.jsp.Page.subservice(Page.java:506)
  at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
  at com.caucho.server.http.Invocation.service(Invocation.java:315)
  at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
  at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
  at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
  at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
  at java.lang.Thread.run(Thread.java:534)

What's the problem?
I think, I use wrong passwords.

Please, help me.
« Last Edit: November 05, 2008, 06:38:35 AM by onepavel » Logged
onepavel
Newbie
*
Offline Offline

Posts: 2


« Reply #24 on: November 05, 2008, 04:09:47 AM »

I have replaced myself mail.jar and activation.jar from wrapper and all has earned.
Logged
vks87
Intergalactic Cowboy
*****
Offline Offline

Posts: 63


« Reply #25 on: April 06, 2009, 11:33:13 PM »

I agree with badckok...
Logged
kdorsey
Trekkie
**
Offline Offline

Posts: 16


« Reply #26 on: June 22, 2009, 10:53:47 AM »

I have updated the war file location in both posts.  It is also in our FAQ on the Help Desk (the better location to get it as that updates when the url updates):

http://helpdesk.lunarpages.com/faq.php?do=article&articleid=114

Thanks.

I wish I would have seen this like 3 months ago.  Was struggling mightily with java.
Logged

Pages: 1 [2]   Go Up
  Print  
 
Jump to: