Problem in tracking  Transport.send(msg)

{color:#ff0000}+protected PasswordAuthentication getPasswordAuthentication()+
+{ return new PasswordAuthentication("username","password");+
+}+
+});+
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to));
msg.setSubject(subject);
msg.setText(message"Dear Mail Crawler, \n\n No spam to my email, please!");{color}
{color:#ff0000}Transport.send(msg);{color}
{color:#ff0000}System.out.println("Done");{color}
now whenever controller comes at Transport.send(msg); and if network connection fails, then controller keep on same point until it doent gotta any network connection
As a result user dont understand what goes wrong
as it doesnt went ain any exception we cant throw any error msg or cant redirect to any error page.
how we can examine timing of controller like if controller stays on Transport.send(msg) more than 5 minute then throws exception
can we do like this???

If you wanted to solve the problem as quickly as possible, you would've read the
docs and had the answer by now. Really, it's not that difficult. Go to the first page
of the javadocs. Scroll to the bottom where it tells you that each of the providers
has properties that are specific to the provider. Click on the link for the SMTP
provider. Scroll down that page until you see the word "timeout".
Go ahead, you can do it...

Similar Messages

  • Transport.send(msg) size limit?!?

    Hello,
    I am having some trouble with my javamail application. I am able to send and retrieve e-mails with no problem, but sometimes when I try to send a large message, some of the message seems to be cut off, so that when I retrieve the message, only 1/2 of it is there.
    Message msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(from));
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
    msg.setSubject(subject);
    msg.setHeader("X-Mailer", mailer);
    msg.setSentDate(new Date());
    msg.setContent(message_param, "text/plain");
    //*** send the message
    Transport.send(msg);
    message_param is a String that holds the message.
    Thank you for you help

    I also noticed that after a certain number of lines in my message, there are blank lines being inserted which aren't in the original message. For example, my message looks ok for about 4-5 lines, but then after that, the rest of the message is on every other line, etc...
    Thanks again

  • Problem in sending mail for a pop3 account using transport.send(msg)

    hi,
    i am having problem in not able to send mail for a pop3 account ...
    I have written an email gateway which listens to my pop3 account...on email arrival it listens nd extract the contents and send it as an sms msg...upon failure it needs to deliver the mail to sender id.I am using quartz to listen.
    i am using jboss for server and java mail api.
    here is my code
    MimeMessage mimemsg = new MimeMessage(session);
                                                           mimemsg.setFrom();
                                                           mimemsg.setRecipients(Message.RecipientType.TO, to);
                                                           mimemsg.setSubject(subject);
                                                           mimemsg.setText(parsedText);
                                                           mimemsg.setSentDate(new Date());
                                                           mimemsg.setContent(strBuff.toString(), "text/html");
                                                           System.out
                                                                                    .println("Before sending mail");
                                                           Transport.send(m);
                                                                System.out.println("message sent successfully");
    excepition i am getting is :
    2008-09-12 11:45:11,140 INFO [STDOUT] Before sending mail
    2008-09-12 11:45:11,140 ERROR [STDERR] javax.mail.IllegalWriteException: POP3 messages are read-only
    2008-09-12 11:45:11,140 ERROR [STDERR]      at com.sun.mail.pop3.POP3Message.saveChanges(POP3Message.java:438)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at javax.mail.Transport.send(Transport.java:97)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at com.openstream.emailgateway.sources.ListenEmailGateway.execute(ListenEmailGateway.java:422)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.Container.invoke(Container.java:960)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor.delivery(MessageEndpointInterceptor.java:263)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor.invoke(MessageEndpointInterceptor.java:140)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at $Proxy73.execute(Unknown Source)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.resource.adapter.quartz.inflow.QuartzJob.execute(QuartzJob.java:57)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    2008-09-12 11:45:11,171 INFO [STDOUT] USer flag ..[Ljava.lang.String;@115c6cb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    as i am writing the message failure details to a template...
         //on failure to send messages , reply to the sender about the failure
                                                                strBuff= tempDetail.writeToTemplate(smsmsg);     
    is that bcoz i am getting an exception

  • Javamail Transport.send problem

    I send an email once in a while from my web application on a virtual dedicated server. Usually the email works. But sometimes Transport.send hangs up. Processing just stops at that statement. I don’t get anything from debug.
    public class SendEmail {
        public void SendEmail(String toEmailAddress,
                String fromEmailAddress,
                String smtphost, String subject, String content)
                throws AddressException, MessagingException {
            // Create a mail session
            java.util.Properties props = new java.util.Properties();
            props.put("mail.smtp.host", smtphost);
            props.put("mail.debug", "true");
            Session session = Session.getInstance(props, null);
            // Construct the message
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress(fromEmailAddress;));
            msg.setRecipient(Message.RecipientType.TO, new InternetAddress(toEmailAddress));
            msg.setSubject(subject);
            msg.setText(content);
            // Send the message
            Transport.send(msg);
            return;
    }What could be causing the problem with Transport.send? Any help would be very much appreciated. Thanks.

    I didn’t get anything from debug. No messages at all. I'm on Centos and looked at the console. Is this not correct?
    I added this code to try to capture exceptions:
    try {
                Transport.send(msg);
            } catch (Exception e) {
                try {
                    out = new BufferedWriter(new FileWriter("TestLog.txt", true));
                    out.newLine();
                    out.write(e.getMessage());
                    out.newLine();
                    out.close(); 
                } catch (Exception err) {
                } finally {
            } finally {
                }But I haven't been able to duplicate the problem since then. I'm not familiar with jstack, so I'll have to research it.
    Thanks for your response.

  • Help transport .send(message) problem

    I am getting an error at transport.send(message)
    javax.mail.SendFailedException: Sending failed; nested exception is: class javax.mail.AuthenticationFailedException After eleminating all lines the error is at transport.send(msg)
    Please help - tell me what I have been doing wrong
    My code - is java mail using a jsp
    try{
         //Properties props = System.getProperties();
    Properties props = new Properties();
    Store store;
    props.put("mail.smtp.host", "smtp.snet.yahoo.com");
    props.put("mail.smtp.auth", "true");
    Session s = Session.getInstance(props,null);
    MimeMessage message = new MimeMessage(s);
    InternetAddress from = new InternetAddress("[email protected]");
    message.setFrom(from);
    String toAddresses = request.getParameter("to");
    message.addRecipients(Message.RecipientType.TO, toAddresses);
    String ccAddresses = request.getParameter("cc");
    message.setRecipients(Message.RecipientType.CC, ccAddresses);
    String bccAddresses = request.getParameter("bcc");
    message.setRecipients(Message.RecipientType.BCC, bccAddresses);
    String subject = request.getParameter("subject");
    message.setSubject(subject);
    message.setSentDate(new Date());
    String text = request.getParameter("text");
    message.setText(text);
    Transport.send(message); //error is here
    %>

    You are specifying authentication to be used, but you aren't supplying any authentication credentials, hence the AuthenticationFailedException.
    You need to create an Authenticator class. If you just need simple username/password authentication, just create a class to handle this.
    For example:
    public class SimpleAuthenticator extends Authenticator {
      private String username;
      private String password;
      private PasswordAuthentication auth;
      public java.lang.String getPassword() {
        return password;
      public PasswordAuthentication getPasswordAuthentication() {
        if(auth == null) {
          auth = new PasswordAuthentication(username, password);
        return auth;
      public java.lang.String getUsername() {
        return username;
      public void setPassword(java.lang.String password) {
        password = password;
      public void setUsername(java.lang.String username) {
        username = username;
    }Then, when you create the session:
    SimpleAuthenticator auth = new SimpleAuthenticator();
    auth.setUsername("yourusername");
    auth.setPassword("yourpassword");And instead of
    Session s = Session.getInstance(props,null);use
    Session s = Session.getInstance(props,auth);

  • URGENT::Status returned by Transport.send() and problem with mail.smtp.host

    Hello,
    I am writing a code to send an email using JavaMail. I have added mail.jar and activation.jar in the classpath. Also I would like to mention that I am using Weblogic6.1 SP4.
    A bunch of questions:
    1. After calling Transport.send(), how do i know if the mail was sent successfully or not ?? Is there anyway I can handle that?
    2. I am using props.put(mail.smtp.host, <some-value>). What should be this <some-value> ?? Where can I get this value from??
    And is this value sufficient for the code to know that which server we are using for it? Do we need to give any URL/Port etc? How does this work?
    3. Is there anything else other than smtp host, username and password to be added to props?? Do we need to create a properties file??
    4. After doing these things, do I need to create a mail session in the Weblogic server also or is it a different method?
    Please help me in resolving these issues.
    Thanks

    Thanks for your kind answers, Dr. Clap..!!
    However, I will again like to ask u this:
    1. As i said that I installed Weblogic 6.1 in my local machine, can I use it as the mail server? As the server is local to my machine, i know that its only me who is the incharge of it. How do I know what smtp host to use.
    2. I am using this code:
    public callService(ServiceRequest request) throws Exception {
         EmailRequest req = (EmailRequest) request;
         Session session = null;
         MimeMessage msg = new MimeMessage(session);
         String accNum = req.getAccountNumber();
         String toAddress = req.getToAddress().trim();
         String fromAddress = generalConfig.FROM_EMAIL_ADDRESS;
         String subject = req.getSubject().trim();
         String message = req.getMessage().trim();
         String [] arrToAddress = null;
         String fileName = "./"+accNum+".htm";
         if (toAddress != null) {
    arrToAddress = convertToArray(toAddress);
         Properties props = System.getProperties();
         props.put("mail.smtp.host", "MYSERVER"); //STILL NEED TO FIGURE OUT WHAT VALUE TO PUT HERE
    session = Session.getDefaultInstance(props);
         setRecipientsTo(msg,arrToAddress);
         msg.setFrom(new InternetAddress(fromAddress));
         msg.setSubject(subject);
         msg.setText(message);
    MimeMultipart mp = new MimeMultipart();
    MimeBodyPart text = new MimeBodyPart();
         text.setDisposition(Part.INLINE);
         text.setContent(message, "text/html");
         mp.addBodyPart(text);
         MimeBodyPart file_part = new MimeBodyPart();
         File file = new File(fileName);
         FileDataSource fds = new FileDataSource(file);
         DataHandler dh = new DataHandler(fds);
         file_part.setFileName(file.getName());
         file_part.setDisposition(Part.ATTACHMENT);
         file_part.setDescription("Attached file: " + file.getName());
         file_part.setDataHandler(dh);
         mp.addBodyPart(file_part);
         msg.setContent(mp);
    Transport.send(msg); //send message
    In this code, like I am using Properties class, will this code work fine(as it is) even if I dont make any Properties text file?? or is it mandatory for me to make the properties text file and to add some values to it?
    I am sorry, I may sound a bit dumb, but I just need to learn it somehow.
    Thanks.
    P.S: convertToArray() and setRecipientsTo() are my own defined private methods.

  • JavaMail application hanged with no error throwed at Transport.send

    JavaMail application hanged with no error throwed at Transport.send,even though I set the timeout property
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import javax.mail.internet.MimeUtility;
    public class tt {
         static Properties props=null;
         static boolean needAuth=true;
         static MailAuthenticator authenticator = null;
         static String host="host";
         static String account="account";
         static String password="pwd";
         static String sender="sender";
          * @param args
          * @throws Exception
         public static void main(String[] args) throws Exception{
               if (props == null) {
                     props = new Properties();
                     props.put("mail.smtp.host", host);
                     props.put("mail.smtp.timeout      ", "1000");
                     props.put("mail.smtp.connectiontimeout      ", "1000");
    //                 props.put("mail.debug", "true");
                     props.put("mail.smtp.auth", String.valueOf(needAuth));
                     authenticator = new MailAuthenticator(account, password);
                 MailData mailData = new MailData();
                 mailData.setSubject("altireport mail configuration");
                 mailData.setContent("mail server has been configured successfully.");
                 mailData.setRecipients(new String[]{"[email protected]"});
                 final Session session = Session.getInstance(props, authenticator);
                 final MimeMessage msg = new MimeMessage(session);
                 InternetAddress from = new InternetAddress(sender);
                 msg.setFrom(from);
                 //        msg.setSender(from);
                final InternetAddress[] addressTo = new InternetAddress[mailData.getRecipients().length];
                 for (int i = 0; i < mailData.getRecipients().length; i++) {
                     addressTo[i] = new InternetAddress(mailData.getRecipients());
         msg.addRecipients(Message.RecipientType.TO, addressTo);
         //msg.setSubject(mailData.getSubject());
         msg.setSubject(MimeUtility.encodeText(mailData.getSubject(), "UTF-8", "B"));
         MimeBodyPart bodyPart1 = new MimeBodyPart();
         bodyPart1.setContent(mailData.getContent(), "text/plain; charset=UTF-8");
         MimeMultipart multipart = new MimeMultipart();
         multipart.addBodyPart(bodyPart1);
         msg.setContent(multipart);
         msg.setSentDate(new Date());
    //     msg.saveChanges();
         for(int i=0;i<10;i++){
              new Thread(new Runnable(){
                             public void run() {
                             try {
                                  System.out.println("send...");                                   
                                  Transport.send(msg);
                                  } catch (Exception e) {
                                       e.printStackTrace(System.out);
                        System.out.println("end!");
              }).start();
    class MailData {
    private String[] recipients = null;
    private String subject = null;
    private String content = null;
    private String attachment = null;
    private String attachmentName = null;
    * @return the attachment
    public String getAttachment() {
    return attachment;
    * @param attachment the attachment to set
    public void setAttachment(String attachment) {
    this.attachment = attachment;
    * @return the content
    public String getContent() {
    return content;
    * @param content the content to set
    public void setContent(String content) {
    this.content = content;
    * @return the recipients
    public String[] getRecipients() {
    return recipients;
    * @param recipients the recipients to set
    public void setRecipients(String[] recipients) {
    this.recipients = recipients;
    * @return the subject
    public String getSubject() {
    return subject;
    * @param subject the subject to set
    public void setSubject(String subject) {
    this.subject = subject;
    * @return the attachmentName
    public String getAttachmentName()
    return attachmentName;
    * @param attachmentName the attachmentName to set
    public void setAttachmentName(String attachmentName)
    this.attachmentName = attachmentName;
    class MailAuthenticator extends Authenticator {
    private PasswordAuthentication authentication;
    public MailAuthenticator(String account, String password) {
    authentication = new PasswordAuthentication(account, password);
    protected PasswordAuthentication getPasswordAuthentication() {
    return authentication;
    I have tried use session to get a SMTPTransport instance to use sendMessage ,but still have the same problem.No exception ,No error.
    This problem doesn't appear always. It appears sometimes.
    I hope get help for someone who has the solution for this problem.
    Thanks in advanced.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Ok, I think I see the problem:
         props.put("mail.smtp.timeout      ", "1000");
         props.put("mail.smtp.connectiontimeout      ", "1000");
    Why do you have spaces at the end of the property names?
    Those spaces are not being ignored, which means you've
    set the wrong properties.

  • What's the problem of this mail sending program

    Hi,
    I have Written following code. I have wriiten & run this code in Eclipse. Mail.jar & Activation.jar both jar file i kept in the webcontent/web-inf/lib
    directory. & I also added this jar file using builpath->add External Library. But when run this code then it throws the following exception. What's the problem of code? IS there anybody can help me? Please help me.
    My code is : UserMail.jsp
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <title>Mail Sending Program</title>
    <%@ page import="javax.mail.internet.*"%>
    <%@ page import="javax.mail.*"%>
    <%@ page import="java.util.*"%>
    </head>
    <body>
    <%
    String to = "[email protected]";
    String from = "[email protected]";
    String host = "192.168.1.1";
    String txt = "I am from jsp of java";
    String subject = "For testing";
         Properties props = System.getProperties();
         props.put("mail.smtp.host", host);
         Session session1 = Session.getDefaultInstance(props, null);
         MimeMessage msg = new MimeMessage(session1);
         try{
              InternetAddress to1 = new InternetAddress(to);
        msg.setFrom(new InternetAddress(from));
       msg.addRecipient(Message.RecipientType.TO,to1);
       msg.setSubject(subject);
      msg.setText(txt);
          msg.setSentDate(new Date());
        Transport.send(msg);
         catch(Exception e){
              e.printStackTrace();
    %>
    </body>
    </html>Exception is:
    javax.mail.MessagingException: Could not connect to SMTP host: 192.168.1.1, port: 25;
      nested exception is:
         java.net.SocketException: Software caused connection abort: connect
         at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
         at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
         at javax.mail.Service.connect(Service.java:275)
         at javax.mail.Service.connect(Service.java:156)
         at javax.mail.Service.connect(Service.java:105)
         at javax.mail.Transport.send0(Transport.java:168)
         at javax.mail.Transport.send(Transport.java:98)
         at org.apache.jsp.UserMail_jsp._jspService(UserMail_jsp.java:73)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Software caused connection abort: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
         at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
         at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
         ... 27 moreWith regards
    Bina

    javax.mail.MessagingException: Could not connect to SMTP host: 192.168.1.1Is this host Ip correct. If Ip is correct then this host should be a mail exchange server. Hope u did not use Ip address of ur machine ;-)
    By the way hope u recd the test mail during my testing....lol
    Regards
    Rohit

  • How to track transporter of scheduled transport (TMS)?

    Prior to audit requirement,basis has been asked by auditor to provide all the selected transport lists and the name of the transporters for each selected transports.The problem is,most of the transports have been done through TMS (Schedule) and transporter cannot be tracked using SE16 and tplog because for sheduled transport,TMS will be captured as a transporter. Anybody here can advise me on this?

    Hi Ali,
    I strongly recommend to use the proper forum for this and your other request (How to track transporter of scheduled transport (TMS)?  )with the same question....
    So please close these 2 threads and post it in Software Logistics
    There the chance is better to get the required information...
    b.rgds, Bernhard

  • Java mail Transport.send()

    I'm getting a cryptic message when I call Transport.send(messag_object):
    no provider for address type: rfc822
    exception thrown in non-transactional ejb invoke:
    com.ssga.exception.MailManagerException
    I am using a stateless session bean to do the work.
    This call to Transport.send() is the last line in the EJB method before returning.
    Thanks
    Paul Dudley
    [email protected]

    Also make sure that you have tha activation.jar.
    Regards,
    Eric
    "Jim Typrowicz" <[email protected]> wrote in message
    news:[email protected]..
    >
    I found a reference to a mail problem in the Newsgroup. It said that WLSis missing
    two files. I downloaded the mail.jar from sun and put it in front of theweblogic.jar
    file and now the e-mail works.
    "Jim Typrowicz" <[email protected]> wrote:
    I'm getting the same error. If you find something out please let me
    know, and
    I'll do likewise. Thanks.
    "Paul Dudley" <[email protected]> wrote:
    I'm getting a cryptic message when I call Transport.send(messag_object):
    no provider for address type: rfc822
    exception thrown in non-transactional ejb invoke:
    com.ssga.exception.MailManagerException
    I am using a stateless session bean to do the work.
    This call to Transport.send() is the last line in the EJB method before
    returning.
    Thanks
    Paul Dudley
    [email protected]

  • Failure sending msg

    I have twi set of S60 series 1 is E75 and 2 is 6720 classic I face the problem of sending msg  after few days I contact to service provider he said that ur set has fault but our service center has no fault I check it its ture our set has fault and this fault cnnot remove until I format the cell phone in last mount format my cell phone 4 times plz help abot to solve this problem is this any kind of virus in my cell phone which is padding through my PC after connecting My PC my cell phone create the problem but I have latest antivirus how I can solve this problem.

    There are 2 things u need to clarify before proceeding:
    1. Check ure operator SMS centre / SMSC for confirmation
    2. Check all the appropriate settings, to do this u might refer to a friend whom having the same service provider and/or phone.
    3. Swap ure SIM card to another phone and try to send and receive the SMS.
    Hope u'll get back here with the result on all above questions.
    TQ
    I'm an Xploit - Please feel free to post your issues, feedbacks in this discussion forum and I'll do my level best to help, otherwise my knowledged friends whom are around willing to help you. Thank you !

  • I keep getting Alarm popups saying that it cannot send msg using the server null. I think I have disabled email (I use Gmail) and the calendar however I still get these popups and I can't close them?

    I keep getting Alarm popups saying that it cannot send msg using the server null.
    I think I have disabled email (I use Gmail) and the calendar however I still get these popups and I can't close them?
    How can I disable the Alarm popups?
    Thanks
    Brian

    OS X Mail: Troubleshooting sending and receiving email messages - Apple Support
    Google Mail recently implemented additional security measures "for your protection" of course. The manifestation of that may be the requirement to create a unique, "application-specific" password for each one of the various Google services you may use. That requirement probably includes Google Mail. So if the above Apple Support document doesn't resolve the problem, research Google's application-specific password requirements, and how to configure Mail to use it.
    I asked the Hosts to edit or obscure the email address in your post.

  • Nokia6700s unable to send msg

    i've just bought this phone but i'm not able to send msg out although i can receive msg and call and receive calls. i don't know wat is the problem, any help? 

    You probably need to set up the Message Centre Number setting. Contact your network for the Message Centre Number and instructions on now to set it up.

  • Hi. I use Adobe Acrobat XI pro to make a PDF ebook embedded with audio. It works really well on my computer-I can read the book and hear the auto play mp3. The problem is, when I send it to my customers, they have difficulty hearing the audio. A few of th

    Hi. I use Adobe Acrobat XI pro to make a PDF ebook embedded with audio. It works really well on my computer-I can read the book and hear the auto play mp3. The problem is, when I send it to my customers, they have difficulty hearing the audio. A few of them say they have Flash player on their PC and somehow they still can't hear, some say their Google Chrome browser tells them they've already got one flash player while they try to download one. For me, I had to download two versions of Flash player to be able to access to the audio. I don't know what the problem is, is it because it's the latest version of Adobe Acrobat XI pro that people with older version of Adobe reader or flash player can't open it properly? Or is it something else? How can I make sure every customer with different system can access to my books? Hope to hear from you ASAP! Thank you very much.

    And how are the customers accessing the PDFs?
    What devices are they using?
    What program or apps with versions are they using?
    I this age of other then PDF eBooks formats and reader program and apss for computers and mobile devices for these formats I would look at creating the books in one or more of the eBook formats.
    Google Chrome and FireFox both have their own version of a PDF reader plug-in and they are well known to be less capable than Adobe Reader. It is possible to configure these products to use Adobe Reader.

  • HT1725 I bought an App last month, doesn't work. consulted the manufacture they sent me to iTunes for refund, reported the problem to iTunes, they sending me back to Manufacturer.

    I bought an App last month, doesn't work. consulted the manufacture they sent me to iTunes for refund, reported the problem to iTunes, they sending me back to Manufacturer. Can someone please assist me on this, I need my refund for this non functional App. BSSoft and iTunes Stores do something here, when I go back to report it again, I get an error message stating "...this problem has been reported or too old to report..."

    Debit card? Are you sure?
    USA iTunes Store does not appear to accept debit cards - http://www.apple.com/legal/itunes/us/terms.html  "The iTunes Store, Mac App Store, App Store, and iBookstore services (“Services”) accept these forms of payment: credit cards issued by U.S. banks, payments through your PayPal account, iTunes Cards, iTunes Store Gift Certificates, Content Codes, and Allowance Account balances."

Maybe you are looking for

  • Problem to load XML SQL Utility into other user

    Hi, I need help to load XML Utility into other user than "scott"tiger". I loaded both xmlparser.jar and oraclexmlsql.jar into "scott/tiger", it works and creating functions and testing work fine. But when change USER_PASSWORD to another user, it gave

  • Billing type  does not exist in application CRMB

    Dear all, I am trying to invoice a service confirmation and the corresponding entry is not found in billing due list. When I analyse the missing entry in /n/bea/crmb04, System is throwing an error that corresponding billing type and itemcategory are

  • Macbook Pro does not boot after replacing HD

    I have a Macbook Pro that I bought in early 2007. It came with 10.4, and I have since upgraded to 10.5, and then 10.6. I decided to upgrade the original internal HD to a 500GB HD. I used Time Machine to back up the orignal HD. After performing the su

  • PDF from MacBook Pro to ipad?

    Want to move some self-created PDFs to my iPad -- files too big to email easily. Thanks to other discussions that showed up when I posted this, I've found some answers -- thanks

  • No audio out preference in utilites

    here is my post in the macbook pro forum http://discussions.apple.com/message.jspa?messageID=7809239#7809239 well much to my surprise, after i updated to leopard 10.5.4 I now have no control over my output sound. i also have quicktime 7.5. I don't kn