Results 1 to 4 of 4
  1. #1

    Default help javax.mail libraries


    unsaon pag run ni nga program sa laing computer?

    mo run ni sa akong computer pero sa lain dili.

  2. #2

    Default Re: help javax.mail libraries

    import java.util.Properties;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;


    public class Mailtest {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    String sender = "eiffel2985@gmail.com";
    String recipient ="eiffel2985@gmail.com";
    String subject = "test subject";
    String messge = "gamai ko otin";
    // TODO code application logic here
    Properties props = new Properties();
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.socketFactory.class",
    "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.port", "465");

    Session session = Session.getDefaultInstance(props,
    new javax.mail.Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication("eiffel2985@gmail.com","jul y291985");
    }
    });

    try {

    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(sender));
    message.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(recipient));
    message.setSubject(subject);
    message.setText(messge);

    Transport.send(message);

    System.out.println("Done");

    } catch (MessagingException e) {
    throw new RuntimeException(e);
    }
    }


    }

  3. #3

    Default Re: help javax.mail libraries

    download and install JRE (Java Runtime Environment).

    if you need to program and compile sa lain computer, (javac.exe class.java), download and install JDK (Java Development Kit).

  4. #4

    Default Re: help javax.mail libraries

    besides having a JDK and JRE, you should have a mail.jar and activation.jar in your JVM/JDK1.6/JRE/lib/ext. This can be downloaded from Oracle.com as JavaMail v1.4.4.

  5.    Advertisement

Similar Threads

 
  1. HELP! Can't log in... no verification e-mail sent to me
    By AlienMagic in forum Support Center
    Replies: 29
    Last Post: 05-03-2011, 02:56 AM
  2. bro i forgot my password in Yahoo mail pls help me
    By demise in forum Networking & Internet
    Replies: 9
    Last Post: 08-19-2010, 10:41 AM
  3. Help! I can't open my Yahoo Messenger and Yahoo Mail shortcut!
    By raging_hero in forum Software & Games (Old)
    Replies: 12
    Last Post: 03-04-2010, 07:00 PM
  4. USPS Priority Mail help
    By technowar in forum General Discussions
    Replies: 7
    Last Post: 10-23-2009, 04:58 PM
  5. Replies: 1
    Last Post: 04-02-2009, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top