Trying to send e-mail using JavaMail, JBoss 5, and JNDI

Hello there,
Am using JBoss 5.1.0GA and JDK 1.5.0_19 on OS X Leopard.
Created a working SendMailServlet.
Have now decided to refactor it into two separate classes (extract out JavaMail code to a separate class and create a ServletController).
Am also trying to use JNDI to access the connection properties in the mail-service.xml configuration file residing in JBoss.
The Mailer class contains the reusable functionality needed to send an e-mail:
public class Mailer {
     private Session mailSession;
     protected void sendMsg(String email, String subject, String body)
     throws MessagingException, NamingException {
          Properties props = new Properties();
          InitialContext ictx = new InitialContext(props);
          Session mailSession = (Session) ictx.lookup("java:/Mail");
//          Session mailSessoin = Session.getDefaultInstance(props);
          String username = (String) props.get("mail.smtps.user");
          String password = (String) props.get("mail.smtps.password");
          MimeMessage message = new MimeMessage(mailSession);
          message.setSubject(subject);
          message.setRecipients(javax.mail.Message.RecipientType.TO,
                    javax.mail.internet.InternetAddress.parse(email, false));
          message.setText(body);
          message.saveChanges();
          Transport transport = mailSession.getTransport("smtps");
          try {
               transport.connect(username, password);
               transport.sendMessage(message, message.getAllRecipients());
               Logger.getLogger(this.getClass()).warn("Message sent");
          finally {
               transport.close();
}The MailController class serves as a standard Java Servlet which invokes the Mailer.class's sendMsg() method:
public class MailController extends HttpServlet {
     /** static final HTML setting for content type */
     private static final String HTML = "text/html";
     myapp/** static final HTML setting for content type */
     private static final String PLAIN = "text/plain";
     public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
          doPost(request, response);
     public void doPost(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
          response.setContentType(PLAIN);
          PrintWriter out = response.getWriter();
          String mailToken = TokenUtil.getEncryptedKey();
          String body = "Hello there, " + "\n\n"
                    + "Wanna play a game of golf?" + "\n\n"
                 + "Please confirm: https://localhost:8443/myapp/confirm?token="
                 + mailToken + "\n\n" + "-Golf USA";
          Mailer mailer = new Mailer();
          try {
               mailer.sendMsg("[email protected]", "Golf Invitation!", body);
               out.println("Message Sent");
          catch (MessagingException e) {
               e.printStackTrace();
          catch (NamingException e) {
               e.printStackTrace();
}Have the mail configuration set under $JBOSS_HOME/server/default/deploy/mail-service.xml:
<server>
  <mbean code="org.jboss.mail.MailService" name="jboss:service=Mail">
    <attribute name="JNDIName">java:/Mail</attribute>
    <attribute name="User">user</attribute>
    <attribute name="Password">password</attribute>
    <attribute name="Configuration">
      <configuration>
        <property name="mail.store.protocol" value="pop3"/>
        <property name="mail.transport.protocol" value="smtp"/>
        <property name="mail.user" value="user"/>
        <property name="mail.pop3.host" value="pop3.gmail.com"/>
        <property name="mail.smtp.host" value="smtp.gmail.com"/>
        <property name="mail.smtp.port" value="25"/>
        <property name="mail.from" value="[email protected]"/>
        <property name="mail.debug" value="true"/>
      </configuration>
    </attribute>
    <depends>jboss:service=Naming</depends>
  </mbean>
</server>web.xml (Deployment Descriptor):
<servlet>
    <servlet-name>MailController</servlet-name>
    <servlet-class>com.myapp.MailController</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>MailController</servlet-name>
    <url-pattern>/sendmail</url-pattern>
</servlet-mapping>This is what is outputted when I start JBOSS and click point my browser to:
https://localhost:8443/myapp/sendmail
[MailService] Mail Service bound to java:/Mail
[STDOUT] DEBUG: JavaMail version 1.4ea
[STDOUT] DEBUG: java.io.FileNotFoundException:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/javamail.providers
(No such file or directory)
[STDOUT] DEBUG: !anyLoaded
[STDOUT] DEBUG: not loading resource: /META-INF/javamail.providers
[STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
[STDOUT] DEBUG: getProvider() returning
javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc]
[STDOUT] DEBUG SMTP: useEhlo true, useAuth false
[STDOUT] DEBUG SMTP: trying to connect to host "localhost", port 465, isSSL true
[STDERR] javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 465;
  nested exception is:
     java.net.ConnectException: Connection refused
[STDERR]      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
[STDERR]      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
[STDERR]      at javax.mail.Service.connect(Service.java:275)
[STDERR]      at javax.mail.Service.connect(Service.java:156)
[STDERR]      at javax.mail.Service.connect(Service.java:176)
[STDERR]      at com.myapp.Mailer.sendMsg(Mailer.java:45)
[STDERR]      at com.myapp.MailController.doPost(MailController.java:42)
[STDERR]      at com.myapp.MailController.doGet(MailController.java:26)Why am I getting this java.net.ConnectException: Connection refused exception?
Happy programming,
Mike
Edited by: mwilson72 on Aug 21, 2009 4:49 PM

Hi Peter,
Nice to hear from you again!
Per your advice, this is what my mail-service.xml config file looks like now:
<?xml version="1.0" encoding="UTF-8"?>
<server>
  <mbean code="org.jboss.mail.MailService" name="jboss:service=Mail">
  <attribute name="JNDIName">java:/Mail</attribute>
  <attribute name="User">user</attribute>
  <attribute name="Password">password</attribute>
  <attribute name="Configuration">
     <configuration>
        <property name="mail.store.protocol" value="pop3"/>
     <property name="mail.transport.protocol" value="smtps"/>
        <property name="mail.smtp.starttls.enable" value="true"/>
        <property name="mail.smtps.auth" value="true"/> 
        <property name="mail.user" value="user"/>
        <property name="mail.pop3.host" value="pop3.gmail.com"/>
        <property name="mail.smtp.host" value="smtp.gmail.com"/>
        <property name="mail.smtps.port" value="465"/>
        <property name="mail.from" value="[email protected]"/>
        <property name="mail.debug" value="true"/>
     </configuration>
   </attribute>
   <depends>jboss:service=Naming</depends>
  </mbean>
</server>Now, when I restart JBoss and point my browser to:
https://localhost:8443/myapp/sendmail
I get this exception:
[STDOUT] DEBUG SMTP: useEhlo true, useAuth true
[STDOUT] DEBUG SMTP: useEhlo true, useAuth true
[STDOUT] DEBUG SMTP: trying to connect to host "localhost", port 465, isSSL true
[STDERR] javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 465;
  nested exception is:
     java.net.ConnectException: Connection refused
[STDERR] at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
[STDERR] at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
[STDERR] at javax.mail.Service.connect(Service.java:297)
[STDERR] at javax.mail.Service.connect(Service.java:156)
[STDERR] at javax.mail.Service.connect(Service.java:176)
[STDERR] at com.myapp.Mailer.sendMsg(Mailer.java:45)
[STDERR] at com.myapp.MailController.doPost(MailController.java:42)
[STDERR] at com.myapp.MailController.doGet(MailController.java:26)Does anyone know what I am possibly doing wrong? Is it my code or is it the config file?
-Mike

Similar Messages

  • How to bypass proxy when trying to send a mail using javamail smtp

    Hi,
    I am trying to make a servlet send a mail using javamail smtp protocol on port 25 but i m not able to send getting an exception, i suspect proxy is blocking, so any idea anyone how bypass a proxy.

    And if it does turn out that there's a proxy server blocking access to your target SMTP server, the best way to deal with that is to discuss the issue with the person responsible for your network configuration.

  • Send THAI mail using JavaMail to Lotus Notes (URGENT)

    Hi all
    I experienced the problem when I try to use Javamail to send mail that contains THAI text to Lotus Notes . When I read my mail in Lotus Note,I cannot read it !! . What should I do ?
    Please suggest .
    Regards
    Chairat Tiajanpan
    E-Mail : [email protected]

    � hello!
    Do you know how can I do it? I am desesperated. Please help me.
    I want to send a mail to lotus notes using a Java class.
    What i need to install in my computer for running the class??
    Sorry for my english. I am spanish and i speak english very bad.
    Thanks!!

  • Using JavaMail with Tomcat and JNDI

    I have a web application and I want to make use of JNDI Mail Sessions for sending email in my Web Appln.
    I am using Tomcat4.0.1
    In my server.xml file I declared a resource as follows:
    <Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
    <ResourceParams name="mail/Session">
         <parameter>
         <name>mail.smtp.host</name>
         <value>mail.abc.com</value>
         </parameter>
    </ResourceParams>
    Now Inside my jsp/servlet code i can use something like this:=
    // Acquire our JavaMail session object
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    Session session = (Session) envCtx.lookup("mail/Session");
    // Prepare our mail message
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    InternetAddress dests[] = new InternetAddress[]
    { new InternetAddress(to) };
    message.setRecipients(Message.RecipientType.TO, dests);
    message.setSubject(subject);
    message.setContent(content, "text/plain");
    // Send our mail message
    Transport.send(message);
    But my smtp mail provider uses Authentication.
    So I am looking of some way wherein I can provide the user and password information in the server.xml file itself along with smtp provider.
    My Query is How to do this as i dont see any references for using JavaMail sessions using Authentication
    Any Help highly appreciated
    Thanks
    Raj

    Isnt there anyone who can answer this question or its not a question worthwile
    Awaiting reply
    ...

  • 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.

  • I tried to send a mail message to too many addees. when the rejection came back "cannot send message using the server..." the window is too long to be able to see the choices at the bottom of it. how can i see the choices at the bottom of that window?

    I tried to send a mail message to too many addees. when the rejection came back "cannot send message using the server..." the window is too long to be able to see the choices at the bottom of it. how can I see the choices at the bottom of that window?

    I tried to send it through gmail and the acct is  a POP acct
    I'm not concerned about sending to the long address list. I just can't get the email and window that says "cannot send emai using the server..." to go away. The default must be "retry", because although I cannot see the choices at the bottom of the window if I hit return it trys again... and then of course comes back with the very long pop up window that I cannot see the bottom of so I can tell it to quit trying...

  • Javax.mail.mailexception while am trying to send the mail

    Hi.
    Am trying to send a mail from ADF Application am using SMTP Server to send the mail
    I have added javamail.jar in my libraries
    This is the code am using to send
        public String send() {
            // Add event code here...
            String to;
            to = new String();
            String host = "localhost";
            String from = "[email protected]";
            Properties properties = System.getProperties();
            properties.setProperty("mail.smtp.host", host);
            Session session = Session.getDefaultInstance(properties);
            try{
                MimeMessage message = new MimeMessage (session);
                message.setFrom(new InternetAddress(from));
                message.addRecipient(Message.RecipientType.TO,new InternetAddress("to"));
                message.setSubject(subj);
                message.setText(body);
                Transport.send(message);
                System.out.println ("Sent Message Successfully");
            catch(MessagingException max){
                max.printStackTrace();
            return null;
        }Am getting the exception as below
    javax.mail.MessagingException: [EOF]
         at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1481)
         at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1512)
         at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1321)
         at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:637)
         at javax.mail.Transport.send0(Transport.java:189)
         at javax.mail.Transport.send(Transport.java:118)
         at view.SendMail.send(SendMail.java:78)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    Could any one pls help me?
    regards,
    Prasad K T.

    This question is better asked in a java forum or JavaMail forum {forum:id=975}
    Timo

  • Trying to send e-mail and error message " a copy has been placed in your outbox. the sender address was rejected by the server"

    trying to send e-mail and error message " a copy has been placed in your outbox. the sender address was rejected by the server"

    i have the same problem with my 3gs and tried to add my email acc+pass in the outgoing server but it got rejected.
    just bin on the phone(45min) with my carrier support about this issue they are pretty much scratching there head, the settings i should use gets verified with no problems when i add the outgoung server, but still cant send mails.

  • Unable to sending a mail using odisend mail

    Hi,
    i have a need to send a mail using odi send mail, i am using gmail server getting to send a mail, but it getting error like this
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. d19sm1563829ibh.8
         at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
         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:99)
         at com.sunopsis.dwg.tools.SendMail.actionExecute(SendMail.java:220)
         at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3430)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1491)
         at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:32)
         at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
         at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:540)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
         at java.lang.Thread.run(Thread.java:662)
    please share your opinions for this post
    Regards,
    901202

    http://www.oracle.com/technetwork/java/javamail/faq/index.html#starttls

  • Sending a Directory using JavaMail

    Hi. Can anyone tell me how to send a directory using JavaMail? Thanks.

    what you can do is create a file object and load all the files one by one and attach them as a multipart object to the same mail.
    anurag

  • When trying to send E-mail via AOL i get the message "rejected by the server because it does not allow relaying" I have checked settings as per answers to similar question

    When trying to send E-mail via AOL i get the message "rejected by the server because it does not allow relaying" I have checked settings as per answers to similar question

    From which account does the email not send?  When sending from an account, the iPad will first try to use the aoutgoing server for that account.  If it can't it will try the other accounts listed.in the setting on the iPad for that account.  It soulds like the server for the account is not working and that the alternate server is resjecting the messag since it did not originate ffrom the account associated with that server,  That is to prevent sending spam.

  • Send a mail using smtp server

    i'm new to java mail api
    i'm using a machine which is in a network under a proxy server and a fire wall.our network has a smtp server.
    i tried to send a amil using a smtp server.
    my codes are
    package mailtest;
    import java.util.Properties;
    import javax.mail.Session;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.InternetAddress;
    import javax.mail.MessagingException;
    import java.io.*;
    import javax.mail.Message;
    import javax.mail.Transport;
    public class FirstMail {
    String mailServer;
    String host;
    public FirstMail() {
    //global
    mailServer="mail.smtp.host";
    host="mail.informatics.lk";
    // Get system properties
    Properties myProperties=new Properties() ;
    // Setup mail server
    myProperties.put(mailServer,host) ;
    myProperties.put("mail.smtp.auth", "true");
    // Get session
    Session myMailSession;
    myMailSession=Session.getInstance(myProperties,null);
    //myMailSession.setDebug(true);
    // Define message
    MimeMessage message=new MimeMessage(myMailSession);
    // Set the from address
    //try {
    try {
    message.setFrom(new InternetAddress("[email protected]","CHANAKA ARUNA"));
    catch (UnsupportedEncodingException ex1) {
    System.out.println("CAN NOT SEND FROM");
    catch (MessagingException ex1) {
    System.out.println("CAN NOT SEND FROM");
    // Set the to address
    try {
    message.addRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    catch (MessagingException ex) {
    System.out.println("CAN NOT SEND TO");
    // Set the subject
    try {
    message.setSubject("RE:$$$$");
    catch (MessagingException ex2) {
    System.out.println("WRONG SUBJECT");
    // Set the content
    try {
    message.setText("***chanaka***");
    catch (MessagingException ex3) {
    System.out.println("WRONG MESSAGE");
    // Send message
    try {
    Transport.send(message);
    System.out.println("MESSAGE SENT");
    catch (MessagingException ex4) {
    System.out.println("UNABLE TO SEND");
    public static void main(String[] args) {
    FirstMail firstMail1 = new FirstMail();
    it was not work, but when i use the ip address of smtp server instead of mail.informatics.lk at
    host="mail.informatics.lk";
    it worked properly and i could get a mail to my yahoo address.
    but i have seen some have used host name like
    host="smtp.snet.yahoo.com";
    how can i do it using yahoo smtp server.
    also i want to know whethr i can use that our smtp server from a computer outside of the net work.
    pls help me
    txs lot.

    Almost certainly, if you are behind a proxy server it will only be a proxy for HTTP traffic, and you will not be able to communicate with an SMTP server outside your network. But you have your own SMTP server so why would you want to?
    If you have a proxy server and an SMTP server then there will be people responsible for supporting them. Talk to those people and ask them to give you the basic explanation of networking that you need.

  • Can't send E-mails using Outlook Express on WRT300N

    Hello, I searched through the forums to find problems similar to mine, but everyone had a different router than mine, plus none of the solutions worked for me.
    I just purchaced and installed my router yesterday. Since the install, I have not been able to send e-mails using Outlook Express, but I do recieve e-mails. I am using the WRT300N Wireless-N Router.
    Trying to get my local news service up and running, and right now, e-mail communication is vital........
    Thanks.
    -Ryan French
    Tampa Bay News Online

    Well of course, but the error message says socket error, which doesn't tell how to fix it. Even the Outlook Express help site doesn't give any suggestions to fix anything, other than "Your internet connection has failed," which is not the problem.
    To the disable firewalls suggestion: I did try disabling my firewalls and all of my virus/ e-mail scan software just to check it out. The thing is, I don't see how my Windows XP Firewall, or anything I've been using could be a problem. Right now, because of the error all my sent e-mails are stuck in the outbox, when I disconnect my router and connect everything back up leaving the router out of the picture, the e-mails are sent out as normal. This problem only occurs with the router connected.
    I also need to stream live audio, and I've heard it's a pain using a wireless router...
    Thanks for the suggestions, hopefully someone will provide the winning suggestion so I don't have to call customer service!

  • Sending php mail(); using postfix. Authentication failed.

    Trying to set up my localhost to send php mail() using postfix.
    I did the following:
    Created the sasl_passwd file
    Created the sasl_passwd.db file
    Edited mail.cf in the postfix folder to include relay host: relayhost=smtp.live.com:587
    I'm trying to relay through my hotmail account. The mail.log returns the following:
    Jan 24 13:17:30 Richards-MacBook-Pro.local postfix/error[927]: E75CCE40EE4: to=<[email protected]>, relay=none, delay=1580, delays=1580/0.07/0/0, dsn=4.0.0, status=deferred (delivery temporarily suspended: SASL authentication failed; server smtp.live.com[65.55.162.200] said: 535 5.0.0 Authentication Failed)
    Any ideas what I'm doing wrong here?

    Ok problem solved :)
    Problem was between oracle and MS exchange server. Live server oracle 9i is on linux, and testing server works on windows.
    So the problem was with configuration. Our admins corrected it and now works :). I don't know details.

Maybe you are looking for