Web Hosting Forum | Lunarpages

Author Topic: JavaMail Example / Wrapper  (Read 50245 times)

Danielle

  • Guest
Re: JavaMail Example / Wrapper
« 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.

Offline tobias

  • Spacescooter Operator
  • *****
  • Posts: 37
    • http://www.teande.com
Re: JavaMail Example / Wrapper
« 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

Offline moilejter

  • Intergalactic Cowboy
  • *****
  • Posts: 69
    • http://www.software-smiths.com
Re: JavaMail Example / Wrapper
« 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

Offline tobias

  • Spacescooter Operator
  • *****
  • Posts: 37
    • http://www.teande.com
Re: JavaMail Example / Wrapper
« 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

Offline Eidolon

  • Trekkie
  • **
  • Posts: 18
    • Wright Gallery
Re: JavaMail Example / Wrapper
« Reply #19 on: December 15, 2006, 05:38:35 AM »
Change that line to instead of having "Message$RecipientType.TO" to "Message.RecipientType.TO".
Like paintings? Come see my gallery: www.razorsharpdesigns.com/~gallery

Offline mabadrah

  • Newbie
  • *
  • Posts: 1
Re: JavaMail Example / Wrapper
« 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

Offline appts2

  • Newbie
  • *
  • Posts: 4
Re: JavaMail Example / Wrapper
« 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

Offline appts2

  • Newbie
  • *
  • Posts: 4
Re: JavaMail Example / Wrapper
« 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

Offline onepavel

  • Newbie
  • *
  • Posts: 2
Re: JavaMail Example / Wrapper
« Reply #23 on: November 04, 2008, 05:04:03 PM »
Hello!

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

Code: [Select]
    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@lunarpages.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 »

Offline onepavel

  • Newbie
  • *
  • Posts: 2
Re: JavaMail Example / Wrapper
« 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.

Offline vks87

  • Intergalactic Cowboy
  • *****
  • Posts: 61
Re: JavaMail Example / Wrapper
« Reply #25 on: April 06, 2009, 11:33:13 PM »
I agree with badckok...

Offline kdorsey

  • Trekkie
  • **
  • Posts: 16
Re: JavaMail Example / Wrapper
« 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.

 

Share |