Javamail API problem

I recently downloaded the javamail 1.4 api, nd tried testing the demo code sendmsgsample.java. It gave me the following error -
C:\jdk1.3\bin\msgsendsample.java:78: cannot access javax.mail.Session
bad class file: C:\javamail1.4\lib\mailapi.jar(javax/mail/Session.class)
class file has wrong version 48.0, should be 47.0Please remove or make sure it appears in the correct subdirectory of the classpath.
     Session session = Session.getInstance(props, null);
help?

This is the code we're using (it's an example code we're trying to get to run so we can see what's going on)
import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class msgsendsample
     public static void main(String[] args)
     String to = "[email protected]";
     String from = "[email protected]";
     String host = "mail.ejip.net";
     // create some properties and get the default Session
     Properties props = new Properties();
     props.put("mail.smtp.host", host);
     //sending uses a Session Object so, lets create one
     Session session = Session.getDefaultInstance(props, null);
     try {
          // create a message
          Message msg = new MimeMessage(session);
          msg.setFrom(new InternetAddress(from));
          InternetAddress[] address = {new InternetAddress(to)};
          msg.setRecipients(Message.RecipientType.TO, address);
          msg.setSubject("PittJUG Welcome");
          msg.setSentDate(new Date());
          msg.setText("Hello Carl.\nPittJUG Welcomes you!.");
          Transport.send(msg);
          catch (MessagingException mex)
               System.out.println("\n--Exception handling in msgsendsample.java");
               mex.printStackTrace();
}the error we get is:
com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.1 Mail from 124.125.89.30 ref
used - see http://www.spamhaus.org/SBL/and http://www.spamhaus.org/xbl/
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1
388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at msgsendsample.main(msgsendsample.java:27)

Similar Messages

  • Problem Sending mails in a loop using JavaMail API

    Hello All,
    I am sending emails in a loop(one after the other) using JavaMail API,but the problem is, if the first two,three email addresses in the loop are Valid it sends the Email Properly, but if the Fourth or so is Invalid Address it throws an Exception....
    "javax.mail.SendFailedException: Sending failed;"
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 450 <[email protected]>:Recipient address rejected: Domain not found......
    So if i want to send hundereds of emails and if one of the Emails inbetween is Invalid the process Stops at that point and i could not send the other emails in the Loop......
    How Could i Trap the exception thrown and handle it in such a way, so that the loops continues ..
    Is there something with the SMTP Server....?
    The code which i am using is as follows....
    <Code>...
    try {
    InitialContext ic = new InitialContext();
    Session session = (Session) ic.lookup(JNDINames.MAIL_SESSION);
    if (Debug.debuggingOn)
    session.setDebug(true);
    // construct the message
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(eMess.getEmailSender()));
    String to = "";
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(to, false));
    msg.setRecipients(Message.RecipientType.BCC,
    InternetAddress.parse(eMess.getEmailReceiver(), false));
    msg.setSubject(eMess.getSubject());
    msg.setContent(eMess.getHtmlContents(),"text/plain");
    msg.saveChanges();                
    Transport.send(msg);
    } catch (Exception e) {
    Debug.print("createAndSendMail exception : " + e);
    throw new MailerAppException("Failure while sending mail");
    </Code>....
    Please give me any suggestions regarding it....and guide me accordingly..
    Thanks a million in advance...
    Regards
    Sam

    How about something like the code attached here. Be aware it is lifted and edited out of an app we have here so it may require changing to get it to work. If it don't work - don't come asking for help as this is only a rough example of one way of doing it. RTFM - that's how we worked it out!
    SH
    try {
    Transport.send(msg);
    // If we get to here then the mail went OK so update all the records in the email as sent
    System.out.println("Email sent OK");
    catch (MessagingException mex) {
    System.out.println("Message error");
    Exception ex = mex;
    do {
    if (ex instanceof SendFailedException) {
    if (ex.getMessage().startsWith("Sending failed")) {
    // Ignore this message as we want to know the real reason for failure
    // If we get an Invalid Address error or a Message partially delivered message process the message
    if (ex.getMessage().startsWith("Message partially delivered")
    || ex.getMessage().startsWith("Invalid Addresses")) {
    // This message is of interest as we need to process the actual individual addresses
    System.out.println(ex.getMessage().substring(0, ex.getMessage().indexOf(";")));
    // Now get the addresses from the SendFailedException
    SendFailedException sfex = (SendFailedException) ex;
    Address[] invalid = sfex.getInvalidAddresses();
    if (invalid != null) {
    System.out.println("Invalid Addresse(s) found -");
    if (invalid.length > 0) {
    for (int x = 0; x < invalid.length; x++) {
    System.out.println(invalid[x].toString().trim());
    Address[] validUnsent = sfex.getValidUnsentAddresses();
    if (validUnsent != null) {
    System.out.println("Valid Unsent Addresses found -");
    if (validUnsent.length > 0) {
    for (int x = 0; x < validUnsent.length; x++) {
    System.out.println(validUnsent[x].toString().trim());
    Address[] validSent = sfex.getValidSentAddresses();
    if (validSent != null) {
    System.out.println("Valid Sent Addresses found -");
    if (validSent.length > 0) {
    for (int x = 0; x < validSent.length; x++) {
    System.out.println(validSent[x].toString().trim());
    if (ex instanceof MessagingException)
    ex = ((MessagingException) ex).getNextException();
    else {
    // This is a general catch all and we should assume that no messages went and should stop
    System.out.println(ex.toString());
    throw ex;
    } while (ex != null);

  • Problem accessing gmail with IMAP using JavaMail APIs

    Hi,
    I am trying to access my gmail account with JavaMail API. I am able to access it using pop3s but not with IMAP.
    I have used following details:
    protocol: imap
    host: imap.gmail.com
    port: -1 (also tried with 993) but no success.
    My basic code is
    url = new URLName(protocol, getHostname(), 993, mbox,
                              getUsername(), getPassword());
             Properties props = null;
             try {
              props = System.getProperties();
             } catch (SecurityException sex) {
              props = new Properties();
             session = Session.getInstance(props, null);
              session.setDebug(true);
            store = session.getStore(url);
            store.connect();
            folder = store.getFolder(url);
            folder.open(Folder.READ_WRITE);Any pointers?
    Thanks.

    Changed protocol from "imap" to "imaps"....and used port 993...and its working!!!!

  • Question about using JavaMail API to read the calendar folder...

    Hi,
    I've made an application that goes to the mail server, fetches all mails in the calendar folder and tells you the meetings you have in a particular day.
    I'm using JavaMail API for this. My problem is that the application is very slow because I'm forced to fetch (one by one!) the contents of every message.
    My question is: How can Outlook show so fast the mettings you have? Do they have a specific API that allows them to get the right info by only calling certain methods? Is there something similar in Java?
    Thaks for your help!
    Note: I use method:
    folder.fetch(allMessages, fetchProfile);howerver the fetchProfile class does not allow me to specfy that I want to dowload the contents of the message (you only can specify the content_info); specifying all headears does not help me either.

    Clarification:
    The VI you have posted will work as following:
    1) The task will read 2 analog inputs (ai0, ai3).
    2) The acquisition starts, oncece digital signal (trigger) is detected on PFI0
    3) The sampling rate will be as specified in "rate" control - it is continuous analog input acquisition, which means that after trigger is received (point 2), the board will start to generate hardware clock with frequency you specify as "rate"
    4) with each rising edge of that hardware clock, the measurement is taken, and stored into buffer of driver.
    5) DAQmx read will try to read "number of samples per channel" number of samples each time is called - and if there is not enough measurement stored in buffer (step 4), then DAQmx read will wait until DAQ card will measure reaquested number of samples (or timeout occurs before requested number of samples has been acquired)
    6) DAQmx read will be then called 1000 times - so totaly you will read 1000 * "number of samples per channel"  number of samples.
    You do not have to be worried about speed of the loop. In fact, if you need to read just 1000 samples, with 1kS/s, then you can remove for loop and you can change measurement mode from continuous to finite samples, and specify number of samples to read to be 1000. You will read them all properly. I recomend you to read User Manual for your DAQ device - lets say M Series User Manual.
    I hope it is clear now.
    regards,
    stefo

  • JavaMail Installation Problem-Further Help Required

    Hi everyone, I am trying to install and configure JavaMail API and java activation framework so that I may start to try and write a Java Mail application, the problem I am having is that I am unable to get the sample program to work, I am compiling the sample program msgsend.java but I keep getting the following errors (I am using Jbuilder 2):
    Error (36): cannot access directory javax\mail.
    Error (37): cannot access directory javax\mail\internet.
    Error (209): class message not found in class msgsend.
    Error (210): class MessagingException not found in class msgsend
    Error (134): class Session not found in class msgsend
    Error (134): variable Session not found in class msgsend
    Error (139): class Message not found in class msgsend
    Error (139): class MimeMessage not found in class msgsend
    Error (141): class InternetAddress not found in class msgsend
    Error (145): cannot access class Message.RecipientType;neither class nor source found for Message.RecipientType.
    Error (146): Variable InternetAddress not found in class msgsend
    Error (148): cannot access class Message.RecipientType;neither class nor source found for Message.RecipientType.
    Error (149): Variable InternetAddress not found in class msgsend
    Error (151): cannot access class Message.RecipientType;neither class nor source found for Message.RecipientType.
    Error (152): Variable InternetAddress not found in class msgsend
    Error (162): Variable Transport not found in class msgsend
    Error (170): class Store not found in class msgsend
    Error (172): class URLName not found in class msgsend
    Error (172): class URLName not found in class msgsend
    Error (189): class Folder not found in class msgsend
    Error (195): Variable Folder not found in class msgsend
    Error (197): class Message not found in class msgsend
    Error (197): class Message not found in class msgsend
    I have installed JavaMail and java activation framework into the following directories on my hard dirive:
    JavaMail: C:\jdk1.3.1\lib\javamail-1.2
    java activation framework : C:\jdk1.3.1\lib\jaf-1.0.1
    My CLASSPATH is set to
    C:\jdk1.3.1\lib\javamail-1.2;C:\jdk1.3.1\lib\jaf-1.0.1
    I think that I have set this correctly, If not could somenone tell me what the CLASSPATH should be.
    If I have set it correctly, could anyone tell me another reason why I cannot run the sample programand tell me how I may be able to fix it.
    I have done a search on my computer for a file named javax\mail but it just says that javax is not a valid folder.
    Any help would be appreciated
    Thank You
    Noel

    >
    Noel, I have said it twice now... your classpath is
    supposed to be:
    C:\jdk1.3.1\lib\javamail-1.2\mail.jar;C:\jdk1.3.1\lib\j
    f-1.0.1\activation.jar
    /MichaelI have set the classpath to what you suggested but when I compile the msgsend.java sample I am still getting the same errors as before, the folder where javamail and JavaBeansTM Activation Framework are still in the same location also (C:\jdk1.3.1\lib\javamail-1.2 & C:\jdk1.3.1\lib\jaf-1.0.1).
    Can you tell me what is wrong?
    Thanks
    Noel

  • Order, Paginate and List  emails in JavaMail API

    Am able to sendm and retrieve emails in java using JavaMail API but am having a problem. I would like to sort emails by date, subject, sender etc and also display only a subset of emails using pagination.
                Message[] msgs = folder.getMessages();
                FetchProfile fp = new FetchProfile();
                fp.add(FetchProfile.Item.ENVELOPE);
                folder.fetch(msgs, fp);The function folder.getMessages(); can take 2 arguments (from_index,to_index), but this is according to the way mail server will transalate. POP server will arrange by date while IMAP is unordered. I would like to order the mails then fetch the getMessages(from_index,to_index).
    Another posible way am seeing is fetching all mesages using getMessages() put them in a temporary storage(eg. vector or list), order them and then fetch only the page i want. But this could be very costly in terms of processing resources, which makes me believe there is a better approach and it seems i cant find it.
    Can somenone please advice me on what to do. I will be very greatful.
    Edited by: kagara on Aug 27, 2008 12:27 PM

    With POP3 you have no choice but to download the messages and sort them in the client.
    The POP3 protocol simply doesn't provide a "sort" option.
    With IMAP, some IMAP servers support a "SORT" extension, although JavaMail doesn't
    support it yet.

  • Javamail api and Microsoft Exchange

    Hi there,
    I wonder if there are different settings for the javamail (SMTP, Authentication) when the user is using Micorsoft Exchange.
    The problem is that my user doesn't know what is his SMTP (I usually ask them to go to MS Outlook to figure it out) but since he is using the exchange software how can I tell what is the SMTP?
    are there different setttings for the javamail api in this case?
    thanks
    peter

    P_Primrose and Others,
    I too am having the same issues. At my work i have administrative access to our MS Exchange server and have noticed that the server can be set to use OR block access via SMTP, POP or IMAP. Also the type of connection can also be set, Encrypted connections or non-encrypted connections.
    Now i my instance I have noted that we have SMTP blocked, therefore no good and i have to swap to IMAP. Yuck. But my problem is that if my application is going to be developed to be used across all environments, will i run into the same problems when using other mail servers, such as Unix servers, etc.
    My question to the world is how can you test a connection to a mail server and find out what it's requirements are??? Is there a way to get the settings from the client's system settings (Regedit)??? If this can be done then it's just a matter of building a routine to mirror and set those variables for your JavaMail.

  • JavaMail API on JDK 1.6

    After going through README of JavaMail 1.4, i realised that it is not tested on JDK 1.6.
    Snippet from README
    The JavaMail API supports JDK 1.4 or higher. Note that we have
    currently tested this implementation only with JDK 1.4 and 1.5.
    I have few queries.
    Am i using wrong JavaMail version?
    If not then, has anybody tested/usedJavaMail 1.4 with JDK 1.6?
    Any issues faced?

    JDK 1.6 was release long after JavaMail 1.4 was released, which would make
    it hard to test JavaMail 1.4 on JDK 1.6. Since the release of JDK 1.6 I've used
    JavaMail 1.4 on JDK 1.6 with no problems. Note that the JavaBeans Activation
    Framework (JAF, aka activation.jar) is included in JDK 1.6.

  • Javamail API not reporting timeout

    Hi,
    I'm writing a POP3 application which pulls mails
    from a mail server processes them and then deletes
    them from the server.
    Occasionally the processing takes a while and the connection
    with the mailserver may timeout. This is fine because if I know
    its timed out, I could reconnect and find the mail and delete it.
    However what is happening is that the connection is timing out but the javamail api gives me no indication of this. The folder and store objects both report that they are open. Even if I use a connectionListener it tells me nothing.
    Now even this might not be a problem if the next oeration where to fail, as the same thing occurs in the transport object, however when I attempt to send it fails and closes the transport.
    However with the store I mark a message as deleted and then close, and it gives no exceptions letting me think I have successfully deleted a message, whereas in reality the underlying socket connection was closed and the message is still on the server.
    I have tried this several times looking at both the debug output on the mail server and from the javamail api.
    Is this a bug I should report or is there something I'm missing
    It seems pretty bad that javamail allows me to delete a message on a connection that is closed and not throw an exception.
    All ideas/suggestions welcome?
    Failing this does anyone know how to get the javamail api to send a NOOP
    command to keep the connection open.
    -vinnie

    I have been setting my timeouts manually.
    Properties props = System.getProperties();
    props.put("mail.imap.timeout",timeoutVal);
    props.put("mail.imap.connectiontimeout",timeoutVal);
    Session session = Session.getInstance(props,null);
    mail.pop3.timeout and mail.pop3.connectiontimeout are what you would want to use. Something else you might want to try is doing a Folder.getMessageCount() or some other low overhead transaction to keep the connection alive.

  • Getting error when sending SMTP mail using javamail api

    hi all
    i am new to javamail api...and using it first-time....i'v used the following code
    <%
    String mailHost="mail.mastsale.com";
    String mailText="Hello this is a test msg";
    String to="<a href="mailto:[email protected]">[email protected]</a>";
    String subject="jsp test mail";
    try
    String from="<a href="mailto:[email protected]">[email protected]</a>";
    String mailhost = "mail.mastsale.com";
    Properties props = System.getProperties();
    props.put("mail.smtp.host", mailhost);
    // Get a Session object
    Authenticator auth = new SMTPAuthenticator( "<a href="mailto:[email protected]">[email protected]</a>", "abcd" );
    Session session1 = Session.getInstance(props,auth);
    //Session.setDebug(true);
    //construct message
    Message msg = new MimeMessage(session1);
    msg.setFrom(new InternetAddress(from,"Your Name"));
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
    msg.setSubject(subject);
    msg.setText(mailText);
    //msg.setHeader("X-Mailer",mailer);
    msg.setSentDate(new Date());
    msg.saveChanges();
    //Send the message
    out.println("Sending mail to " + to);
    Transport.send(msg);
    catch (MessagingException me)
    out.println("Error in sending message for messaging exception:"+me);
    %>
    and
    SMTPAuthenticator.java
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class SMTPAuthenticator extends javax.mail.Authenticator {
    private String fUser;
    private String fPassword;
    public SMTPAuthenticator(String user, String password) {
    fUser = user;
    fPassword = password;
    public PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(fUser, fPassword);
    Now getting error as: Error in sending message for messaging exception:javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550-(host.hostonwin.com) [208.101.41.106] is currently not permitted to relay 550-through this server. Perhaps you have not logged into the pop/imap server 550-in the last 30 minutes or do not have SMTP Authentication turned on in your 550 email client.
    Can anyone help me?

    i got the following error while using the below code,
    -----------registerForm----------------
    DEBUG: setDebug: JavaMail version 1.3.2
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    :::::::::::::::::::::::::::::::::<FONT SIZE=4 COLOR="blue"> <B>Error : </B><BR><HR> <FONT SIZE=3 COLOR="black">javax.mail.AuthenticationFailedException<BR><HR>
    -----------registerForm----------------
    public class SendMailBean {
    public String send(String p_from, String p_to, String p_cc, String p_bcc,
    String p_subject, String p_message, String p_smtpServer,String FilePath) {
    String l_result = "";
    // Name of the Host machine where the SMTP server is running
    String l_host = p_smtpServer;
    //for file attachment
    String filename = FilePath;
    // Gets the System properties
    Properties l_props = System.getProperties();
    // Puts the SMTP server name to properties object
    l_props.put("mail.smtp.host", l_host);
    l_props.put("mail.smtp.auth", "true");
    // Get the default Session using Properties Object
    Session l_session = Session.getDefaultInstance(l_props, null);
    l_session.setDebug(true); // Enable the debug mode
    try {
    MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    l_msg.setFrom(new InternetAddress(p_from)); // Set the From address
    // Setting the "To recipients" addresses
    l_msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(p_to, false));
    // Setting the "Cc recipients" addresses
    l_msg.setRecipients(Message.RecipientType.CC,
    InternetAddress.parse(p_cc, false));
    // Setting the "BCc recipients" addresses
    l_msg.setRecipients(Message.RecipientType.BCC,
    InternetAddress.parse(p_bcc, false));
    l_msg.setSubject(p_subject); // Sets the Subject
    // Create and fill the first message part
    MimeBodyPart l_mbp = new MimeBodyPart();
    //123
    ///////l_mbp.setText(p_message);
    l_mbp.setContent(p_message,"text/html");
    // Create the Multipart and its parts to it
    Multipart l_mp = new MimeMultipart();
         //l_mp.setContent(html,"text/html");
    l_mp.addBodyPart(l_mbp);
    // Add the Multipart to the message
    l_msg.setContent(l_mp,"text/html");
    // Set the Date: header
    l_msg.setSentDate(new Date());
    //added by cibijaybalan for file attachment
         // attach the file to the message
    //Multipart l_mp1 = new MimeMultipart();
         if(!filename.equals(""))
                   String fname = filename;
                   MimeBodyPart mbp2 = new MimeBodyPart();
                   FileDataSource fds = new FileDataSource(fname);
                   mbp2.setDataHandler(new DataHandler(fds));
                   mbp2.setFileName(fds.getName());
                   l_mp.addBodyPart(mbp2);
              // add the Multipart to the message
              l_msg.setContent(l_mp);
    //ends here
         l_msg.setSentDate(new java.util.Date());
    // Send the message
    Transport.send(l_msg);
    // If here, then message is successfully sent.
    // Display Success message
    l_result = l_result + "Mail was successfully sent to : "+p_to;
    //if CCed then, add html for displaying info
    //if (!p_cc.equals(""))
    //l_result = l_result +"<FONT color=green><B>CCed To </B></FONT>: "+p_cc+"<BR>";
    //if BCCed then, add html for displaying info
    //if (!p_bcc.equals(""))
    //l_result = l_result +"<FONT color=green><B>BCCed To </B></FONT>: "+p_bcc ;
    //l_result = l_result+"<BR><HR>";
    } catch (MessagingException mex) { // Trap the MessagingException Error
    // If here, then error in sending Mail. Display Error message.
    l_result = l_result + "<FONT SIZE=4 COLOR=\"blue\"> <B>Error : </B><BR><HR> "+
    "<FONT SIZE=3 COLOR=\"black\">"+mex.toString()+"<BR><HR>";
    } catch (Exception e) {
    // If here, then error in sending Mail. Display Error message.
    l_result = l_result + "<FONT SIZE=4 COLOR=\"blue\"> <B>Error : </B><BR><HR> "+
    "<FONT SIZE=3 COLOR=\"black\">"+e.toString()+"<BR><HR>";
    e.printStackTrace();
    }//end catch block
    //finally {
    System.out.println(":::::::::::::::::::::::::::::::::"+l_result);
    return l_result;
    } // end of method send
    } //end of bean
    plz help me

  • Getting exceptions while sending mail using javamail api

    Hi to all
    I am developing an application of sending a mail using JavaMail api. My program is below:
    quote:
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class sms
    public static void main(String args[])
    try
    String strstrsmtserver="smtp.bol.net.in";
    String strto="[email protected]";
    String strfrom="[email protected]";
    String strsubject="Hello";
    String bodytext="This is my first java mail program";
    sms s=new sms();
    s.send(strstrsmtserver,strto,strfrom,strsubject,bodytext);
    catch(Exception e)
    System.out.println("usage:java sms"+"strstrsmtpserver tosddress fromaddress subjecttext bodyText");
    System.exit(0);
    public void send(String strsmtpserver,String strto,String strfrom ,String strsubject,String bodytext)
    try
    java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties p=new Properties(System.getProperties());
    if(strsmtpserver!=null)
    p.put("mail.transport.protocol","smtp");
    p.put("mail.smtp.host","[email protected]");
    p.put("mail.smtp.port","25");
    Session session=Session.getDefaultInstance(p);
    Message msg=new MimeMessage(session);
    Transport trans = session.getTransport("smtp");
    trans.connect("smtp.bol.net.in","[email protected]","1234563757");
    msg.setFrom(new InternetAddress(strfrom));
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(strto,false));
    msg.setSubject(strsubject);
    msg.setText(bodytext);
    msg.setHeader("X-Mailer","mtnlmail");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent OK.");
    catch(Exception ex)
    System.out.println("here is error");
    ex.printStackTrace();
    It compiles fine but showing exceptions at run time.Please help me to remove these exceptions.I am new to this JavaMail and it is my first program of javamail.Please also tell me how to use smtp server.I am using MTNL 's internet connection having smtp.bol.net.in server.
    exceptions are:
    Here is exception
    quote:
    Javax.mail.MessagingException:Could not connect to SMTP host : smtp.bol.net.in, port :25;
    Nested exception is :
    Java.net.ConnectException:Connection refused: connect
    At com.sun.mail.smtp.SMTPTransport.openServer<SMTPTransport.java:1227>
    At com.sun.mail.smtp.SMTPTransport.protocolConnect<SMTPTransport.java:322>
    At javax.mail.Service .connect(Service.java:236>
    At javax.mail.Service.connect<Service.java:137>
    At sms.send<sms.java:77>
    At sms.main<sms.java:24>

    Did you find the JavaMail FAQ?
    You should talk to your ISP to get the details for connecting to your server.
    In this case I suspect your server wants you to make the connection on the
    secure port. The FAQ has examples of how to do this for GMail and Yahoo
    mail, which work similarly. By changing the host name, these same examples
    will likely work for you.

  • Any changes in JavaMail Api

    Hi
    Is their any change in javamail api with the release of SE 6.
    When was javamail api last updated or changed.
    null

    JavaMail will work fine on Java SE 6.
    JavaMail was last updated about a year ago.

  • X.400 instead of SMTP Protocol and Javamail API

    We have developed a workflow application on Domino 5.0.7. The SmartHost is "MS Exchange Server", because the application will only be accessed by browsers, we are using javaagent to send the email notifications. Due to some domain restrictions on MS Exhchange servers we have implemented Javamail API on the domino server, and it worked fine (I mean the messages were received by the Exchange Clients, using the SMTP addresses like [email protected]). As we dont have available SMTP addresses for all end users in the company we need to use the X.400 addresses. Is there anyone, can help guide about either the avaiability of any X.400 javamail api, or how to use mapi etc? I know it is little bit challenging, but we are struck. thanks

    Currently, the latest version of the JavaMail 1.2 API, X.400 transport protocol is not supported yet. Only the transport SMTP - a message Transport protocol, for sending messages to a server, is supported.
    Allen Lai
    SUN Developer Technical Support

  • Third Party APIs in Java Language which doesnot use JavaMail APIs

    Hi Pals,
    Is there any third party java mail APIs available which doesnot using Sun JavaMail APIs? The third party would have its own APIs which does not use javax.mail. I have to code in Java Platform so if the APIs are java based its nice and useful to me.....
    Thanks & Regards,
    Prakash

    ksp wrote:
    Hi,
    I am using Javamail APIs to send mails. Sometimes Mcafee blocks the mails and its not allowing javax.mail package. Thats why i would like to go for some other third pary which uses their own APIs......What makes you think a third party API would be less prone to interference by McAfee?
    Edited by: sabre150 on Jun 18, 2009 10:39 AM
    :-)

  • Plz help on javamail api (mayagiri)

    Can you tell me that, where can i find the history of javamail api
    like,
    who developed it, what is the motivation behind it?
    why the technology was developed.
    I am student , now persuing masters in IT.
    if possible plz mail me at [email protected]

    Hi Anand,
    This forum is exclusively for discussions related to Sun Java Studio Creator.
    For information related to Javamail please visit:
    http://java.sun.com/products/javamail/
    There is also a forum for questions related to Javamail. The URL to the forum is:
    http://forum.java.sun.com/forum.jspa?forumID=43
    Cheers
    Giri :-)
    Creator Team

Maybe you are looking for

  • Problem using the e-mail button in Acrobat Pro 7.1.0 with Outlook 2013

    I just switched my e-mail application from Mozilla Thunderbird to Outlook 2013. I have always been able to click the e-mail button in Acrobat 7.1.0 to open a blank e-mail message with the PDF file attached. I keep getting an error now that I have Out

  • Context as Input Parameter

    Hi, I need some help regarding context in BO. We have a requirement we need to show two reports from single input. 1. Report Based on Current Year 2. Report Based on Historical Data. Due to large size and dependency to other report, we are storing th

  • The wording on the delete/edit cookies menu is NOT GOOD...

    When I want to delete INDIVIDUAL cookies it is too easy to accidentally delete ALL cookies. Here's what should be changed... 1) REWORD the button to the left. It now says, "Remove Cookies." It SHOULD say, "Remove SELECTED Cookie(S)." 2) There should

  • Themes eating ram?

    do themes use up loads of ram? i didnt think they did at all

  • Can't load sql file from inside jar file?

    hi all i have a sql file inside my jar file and i want to get the path of the sql file to use it in runtime command to restore a sql dump file i used the following but it doesn't work: the path contains invalid characters such %20% instead of and? UR