Bursting Java API throws an error javax.mail.internet.ParseException

Hi,
I am using the BurstingProcessorEngine API call send emails to the employees of an organization.
When i used the bursting file with the paramter of attachments to false, the email goes through. When i change the attachment parameter to yes in the bursting control file then program errors with an exception [oracle.apps.xdo.batch.DeliveryHelper][EXCEPTION] javax.mail.internet.ParseException
following is how i the bursting control file i have used
<?xml version="1.0" encoding="UTF-8" ?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi/" type="bursting">
<xapi:request select="/PAYSLIP_REPORT/PAYSLIP">
<xapi:delivery>
<xapi:email server="exchange.corp.rghent.com" port="25" from="[email protected]">
<xapi:message id="EMAIL1" to="${EMAIL}" content-type="text/html" attachment="true" subject="Test Email">
Hello,
Oracle Workflow
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document key="${EMPLOYEE_NUMBER}" output-type="PDF" output="${EMPLOYEE_NUMBER}.pdf" delivery="EMAIL1">
<xapi:template type="rtf" location="xdo://PAY.XXEPUSDEPADVXML_PDF.en.US/?getSource=true" filter="">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>

Hi,
You need to change the output-type to lower case, ie "pdf".
Regards,
Rajeev

Similar Messages

  • Getting javax.mail.internet.ParseException when parsing MIME message

    Hi All,
    The MIME Content Type is as below.
    Content-Type: application/pdf;
    name="ecm-000669.pdf";
    Content-Disposition: attachment;
    filename="ecm-000669.pdf";
    When executing the following statement
    ContentType ct = new ContentType(contentType);
    where contentType is application/pdf;
    name="ecm-000669.pdf";
    Getting the below error
    javax.mail.internet.ParseException
         at javax.mail.internet.ParameterList.<init>(ParameterList.java:61)
         at javax.mail.internet.ContentType.<init>(ContentType.java:83)
         at oracle.apps.fnd.wf.common.MIMEUtils.handleContent(MIMEUtils.java:488)
         at oracle.apps.fnd.wf.mailer.EmailParser.processSingleContent(EmailParser.java:1851)
         at oracle.apps.fnd.wf.mailer.EmailParser.parseBody(EmailParser.java:2166)
         at oracle.apps.fnd.wf.mailer.EmailParser.parseEmail(EmailParser.java:1195)
         at oracle.apps.fnd.wf.mailer.IMAPResponseHandler.processSingleMessage(IMAPResponseHandler.java:255)
         at oracle.apps.fnd.wf.mailer.IMAPResponseHandler.processMessage(IMAPResponseHandler.java:92)
         at oracle.apps.fnd.cp.gsc.SvcComponentProcessor.process(SvcComponentProcessor.java:659)
         at oracle.apps.fnd.cp.gsc.Processor.run(Processor.java:283)
         at java.lang.Thread.run(Thread.java:534)
    The error is not happening when I remove the semi colon at the end of content-type header as shown below
    Content-Type: application/pdf;
    name="ecm-000669.pdf"
    Can you please tell that semi colon at the end of Content-Type header is not supported in MIME standard? This MIME is coming from the rediff email client. Is there any parameter in Java Mail API to avoid these kind of issues?

    Yes, a trailing semicolon violates the MIME syntax spec.
    You can work around this bug in the client by setting the System property "mail.mime.parameters.strict" to "false",
    as described here: http://javamail.kenai.com/nonav/javadocs/javax/mail/internet/package-summary.html

  • Javax.mail.internet.ParseException: Expected ';', got ","  with copy

    One of our customers recently reported an incident with the IMAP import functionality of our product. The error (javax.mail.internet.ParseException: Expected ';', got ",") occurs on getting the filename of an attachment. We have traced the cause to headers of the MimePart that are not following the relevant RFC specs. We get the error with both JavaMail 1.4 and 1.4.1.
    It fails on headers like:
    Content-Disposition: attachment;
    creation-date=Tue, 22 Jul 2008 10:03:09 GMT;
    filename="test1kb.file";
    modification-date=Tue, 22 Jul 2008 10:03:24 GMTThe error does not occur if we do quote the dates in accordance to the RFC2183(?), like this:
    Content-Disposition: attachment;
    creation-date="Tue, 22 Jul 2008 10:03:09 GMT";
    filename="test1kb.file";
    modification-date="Tue, 22 Jul 2008 10:03:24 GMT"The error however does not occur in an earlier version of our product. After comparing the code it turns out that we now always make a copy of the Message-object
    Message copyMessage1 = new MimeMessage((MimeMessage)message)We create this copy to prevent other errors with (badly implemented) IMAP-servers (or emulated IMAP services), in some other error-cases we create yet another copy using:
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    message.writeTo(bos);
    Message copyMessage2 = new MimeMessage(session, new ByteArrayInputStream(bos.toByteArray()));With the malformed headers, both types of copies fail, while the original Message-object works fine. Although I appreciate that all bets are off once RFCs aren't followed by mailclients, we would like to get the same behaviour for the original and the copies (preferably the behaviour of the original of course). Especially since our product is used by a wide variety of customers with different IMAP servers and mailclients (which clearly do not always follow the specs).
    I have a SSCCE available together with 2 EML-files (1 with the faulty headers and 1 with the corrected headers (both manually crafted based on an example mail from our customer)), if you have an e-mail address I can send it to, let me know.

    As you've figured out, the message without the quoting is wrong. If you can report the
    problem to the owner of the program that creates those messages, that would be the
    best approach.
    When you make a copy of the message as you're doing, the message is being parsed
    by JavaMail instead of your IMAP server. JavaMail is parsing the message according to
    the spec. Your IMAP server may have some heuristics that allow it to better handle
    bogus messages. It might be worth considering such heuristics for JavaMail; there's
    already a special hack for the "filename" parameter to handle the case where the filename
    contains whitespace but is not quoted.
    Send your example to me at [email protected] and let me see what I can do to
    improve JavaMail.

  • Javax.mail.internet.ParseException when trying to send a MIME message

    Hi,
    I am using JavaMail to send a MIME message, but I am getting the following exception:
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.mail.MessagingException.<init>(MessagingException.java:34)
    at javax.mail.internet.ParseException.<init>(ParseException.java:27)
    at javax.mail.internet.ParameterList.<init>(Compiled Code)
    at javax.mail.internet.ContentType.<init>(ContentType.java:82)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1051)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1923)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1904)
    at javax.mail.Transport.send(Transport.java:101)
    at FPSend.main(Compiled Code)
    The problem seems to be the header of the message, specifically the class-id filed of the content-type. This is the content-type header that causes javaMail to throw that exception:
    Content-Type: multipart/alternative;
    boundary="------------110059296832670";
    class-id=11:9sc9bnYwM87box:2680047
    I think the ":" character in the class-id is causing the problem. Does anybody know if those characters are valid according to MIME standards? And if they are not valid, is there a work around this problem?
    thank you!

    RFC 2046 doesn't mention the existence of the class-id parameter. But it does say this:Thus, a typical "multipart" Content-Type header field might look like this:
         Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p
    But the following is not valid:
         Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p
    (because of the colon) and must instead be represented as
         Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p"From what I see elsewhere, Class-ID is a Microsoft extension. It wouldn't be surprising to find that Microsoft uses extensions that are incompatible with the MIME standards.

  • Javax.mail.internet.ParseException: Expected ';', got ":"

    Hello Everyone,
    I get 2 exceptions when I use the MimeMultipart's getCount method on e-mail messages that have either a colon or equals characters.
    javax.mail.internet.ParseException: Expected ';', got ":"
        at javax.mail.internet.ParameterList.<init>(ParameterList.java:179)
        at javax.mail.internet.ContentType.<init>(ContentType.java:100)
        at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:651) In the above case the Content-Types of the MimeMultipart BodyParts contain colon(s) as in these examples:
    Content-Type: multipart/alternative;
    boundary="------------106493654088256";
    class-id=2:7dHScNImUABLVHAHX3omUA:1738023
    Content-Type: text/plain; charset=us-ascii; class-id=2:5BrQ7RNUzCDbwrCr3G9UzC:1738023
    Content-Type: text/html; charset=us-ascii; class-id=2:4O40LtDu6zISq4z4eMKu6z:1738023
    I couldn't find any specifications for Content-Type in RFC 822 , which is used by JavaMail.
    I don't have control over what the incoming E-Mail messages contain.
    Because mimeMultipart.getCount(); throws the above exceptions, I'm unable to count the number of body parts in the e-mails that have these special characters (colon, equals sign) in the Content-Type header.
    I am catching the above exception though, so the processing of the rest of the e-mails continues without interruption.
    However, is there any way I could get the count of the body parts in a MimeMultipart message that has problematic Content-Types as shown above?
    Should I file a bug?
    javax.mail.internet.ParseException: Expected ';', got "="
        at javax.mail.internet.ParameterList.<init>(ParameterList.java:179)
        at javax.mail.internet.ContentType.<init>(ContentType.java:100)
        at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:651)In the above case the Content-Types in the Multipart email message are as follows:
    Content-Type: multipart/alternative; boundary=----=_NextPart_boundary_000_aPpABvk398f_v.2.0.ENC7bin
    ------=_NextPart_boundary_000_aPpABvk398f_v.2.0.ENC7bin
    Content-Type: text/plain; charset=us-ascii
    java version "1.5.0_11"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
    JavaMail version 1.4
    I searched everywhere, but couldn't find a solution. Most people are facing this problem.
    Any help is appreciated.

    You're misreading the specs.
    RFC 2045 defines the general syntax rules for the Content-Type header, including the requirements
    for parameters:
      content := "Content-Type" ":" type "/" subtype
                 *(";" parameter)
                 ; Matching of media type and subtype
                 ; is ALWAYS case-insensitive.
      parameter := attribute "=" value
      attribute := token
                   ; Matching of attributes
                   ; is ALWAYS case-insensitive.
      value := token / quoted-string
      token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
                  or tspecials>
      tspecials :=  "(" / ")" / "<" / ">" / "@" /
                    "," / ";" / ":" / "\" / <">
                    "/" / "[" / "]" / "?" / "="
                    ; Must be in quoted-string,
                    ; to use within parameter values{code}
    RFC 2046 is describing the syntax requirements for the boundary value that appears as a separator
    in a multipart message.  That boundary value must follow the RFC 2045 rules when included as a
    parameter in the Content-Type header.
    Understand?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Javax.mail.internet.ParseException

    Hi,
    I get this exception when I use Transport.send(Mimemsg) method.
    javax.mail.internet.ParseException
         at javax.mail.internet.ContentType.<init>(ContentType.java:72)
         at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1016)
         at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1841)
         at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1822)
         at javax.mail.Transport.send(Transport.java:80)
         at com.gm.usbp.ld.common.utils.EmailUtility.sendMail(EmailUtility.java:371)
    I get this exception only when an vacation response(auto response) comes from Yahoo.
    and the content is shown as com.sun.mail.util.SharedByteArrayInputStream@f7757c.
    We are able to parse the mime object (vacation respone from yahoo) and get all the details.then we modify the mime object by setting To address and then again transport the message to SMTP.
    Can any one help me please.

    Am also facing the same issue. Did anyone find a resolution for this problem?
    Regards
    Anoop

  • I got javax.mail.internet.ParseException ...

    Hi, I'm Korean Developer...
    I'm not good at English...
    But I need somebody's help...so I decide to write message...
    javax.mail.internet.ParseException
    at javax.mail.internet.ParameterList.<init>(ParameterList.java:61)
    at javax.mail.internet.ContentType.<init>(ContentType.java:83)
    at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:269)
    at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:159)
    I got Exception wher excute following code...
    int parseCnt = 0;
    partCnt = multipart.getCount();
    I think mail I parsed has some kind of problem...
    I check the whole mail message I found some different feature from others.
    following is the example...
    Content-Type: multipart/mixed; boundary="-MOQ1005285799bcc5883894d30bb8796fb89ea77ad05c";
    boundary statement is ended with ;(semicolon), but others are not...
    Is this Javamail bug...?
    Somebody please help...
    I will really appreciate...

    I've got the same problem, with the following header line:
    Content-type: multipart/related;
    boundary=boundary-test-1;
    type=multipart/related
    Netscape read correctly the message so I think
    there is a bug in JavaMail

  • BlazeDS Introspection Error - javax/mail/internet/AddressException

    I have a basic Java class that sends an email.  If I run it as a standalone Java program, it works fine.  In my Flex app, when I connect to the DataService->BlazeDS and select my destination, I get the Introspection error.
    Do you know how I can troubleshoot this?

    Have you been able to figure this out? I am getting the same

  • Javax.mail.internet.ParseException while busrting report using control file

    Hi everyone...
    I am trying to run a concurrent program that will burst emails using a control file.
    In the data definition i want to use few parameters whose values will be passed from concurrent program.In the data definition i am calling an after report trigger function which will fire the seeded email bursting program.
    My data definition file sample:
    ?xml version="1.0" encoding="UTF-8" ?>
    <dataTemplate name="dataTemplateName" description="Template description" defaultPackage="BIREPORTBURSTINGAK_PKG" version="1.0">
    <parameters>
    <parameter name="P_NAME" dataType="varchar"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
    select
         emp_Id "EmployeeId"
         ,emp_Name "EmployeeName"
         ,emp_Dept "Department"
         ,emp_Org "Organization"
         ,emp_Email "Email"
         ,emp_salary "Salary"
         --,emp_Phone "Phone"
         from reportSample_AK
         where emp_name=:P_NAME
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="afterReportTrigger" source="BIREPORTBURSTINGAK_PKG.afterReportTrigger(:P_NAME)" />
    <dataStructure>
    <group name="G_EMPLOYEE" source="Q1">
    <element name = "EMPID" value="EmployeeId"/>
    <element name = "ENAME" value="EmployeeName"/>
    <element name = "DEPT" value="Department"/>
    <element name = "ORG" value="Organization"/>
    <element name = "EMAIL" value="Email"/>
    <element name = "SAL" value="Salary"/>
    --<element name = "PHONE" value="Phone"/>
    </group>
    </dataStructure>
    </dataTemplate>
    my control file:
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    <xapi:request select="/DATATEMPLATENAME/LIST_G_EMPLOYEE/G_EMPLOYEE">
    <xapi:delivery>
    <xapi:email id="123" server="agni.bangalore.bedford.local" port="25" from="[email protected]" reply-to="[email protected]">
    <xapi:message id="123" to="${EMAIL}" attachment="true" subject=" Dear: ${ENAME}">
    Please review the attachment .
    Regards,Anupama karote
    </xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output-type="pdf " delivery="123">
    <xapi:template type="rtf" location="/usr/tmp/TESTMAIL_AK.rtf" filter=".//LIST_G_EMPLOYEE">
    </xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    my package deatils:
    create or replace package BIREPORTBURSTINGAK_PKG
    As
    P_NAME varchar2(16);
    Function Afterreporttrigger(P_NAME varchar2) Return Boolean;
    end biReportBurstingAK_pkg;
    create or replace package body BIREPORTBURSTINGAK_PKG AS
    Function Afterreporttrigger(P_NAME varchar2) Return Boolean
    is
    v_request_id NUMBER;
    BEGIN
    v_request_id := fnd_request.submit_request('XDO'
    ,'XDOBURSTREP'
    ,NULL
    ,NULL
    ,FALSE
    ,'N'
    ,TO_CHAR(fnd_global.conc_request_id)
    ,'Yes'
    return true;
    End Afterreporttrigger;
    end biReportBurstingAK_pkg;
    i have created data definition and template and attched it to the concurrent program via bi publisher.
    While running the main concurrent program i am getting the following error:
    create or replace package BIREPORTBURSTINGAK_PKG
    As
    P_NAME varchar2(16);
    Function Afterreporttrigger(P_NAME varchar2) Return Boolean;
    end biReportBurstingAK_pkg;
    create or replace package body BIREPORTBURSTINGAK_PKG AS
    Function Afterreporttrigger(P_NAME varchar2) Return Boolean
    is
    v_request_id NUMBER;
    BEGIN
    v_request_id := fnd_request.submit_request('XDO'
    ,'XDOBURSTREP'
    ,NULL
    ,NULL
    ,FALSE
    ,'N'
    ,TO_CHAR(fnd_global.conc_request_id)
    ,'Yes'
    return true;
    End Afterreporttrigger;
    end biReportBurstingAK_pkg;
    Any help is greatly appreciated.
    Regards,

    Am also facing the same issue. Did anyone find a resolution for this problem?
    Regards
    Anoop

  • Send mail through Java program. ERROR javax.mail.MessagingException: [EOF]

    Hi,
    i've a java Mail program which will send the mail thro smtp server.
    when i try to execute this program im getting the error javax.mail.MessagingException: [EOF]
    i've attached both code & error.
    while running the program need to give the arguments
    ex : java SendMail smtpserver frommailid tomailid subject body
    please provide me the solution.
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class SendMail {
         public static void main(String[] args) {
              try
         String smtpServer=args[0];
         String to=args[1];
         String from=args[2];
         String subject=args[3];
         String body=args[4];
         send(smtpServer, to, from, subject, body);
         catch (Exception ex)
         System.out.println("Usage: java SendMail"
         +" smtpServer toAddress fromAddress subjectText bodyText");
         System.exit(0);
         public static void send(String smtpServer, String to, String from
                   , String subject, String body)
                   try
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host", smtpServer);
                   Session session = Session.getDefaultInstance(props, null);
                   Message msg = new MimeMessage(session);
                   msg.setFrom(new InternetAddress(from));
                   msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
                   msg.setSubject(subject);
                   msg.setText(body);
                   msg.setSentDate(new Date());
                   System.out.println("test 1--");
                   Transport.send(msg);
                   System.out.println("test 2--");
                   System.out.println("Message sent OK.");
                   catch (Exception ex)
                   ex.printStackTrace();
    thanks for the help in advance.
    regs
    lal.

    I ran into a similar error today. I fixed it by setting up SMTP authentication because my ISP's help pages said that they would allow only SMTP authentication.
    Here is what I did:
    Transport transport =
    mailConnection.getTransport("smtp");
    transport.connect(
    "hostname", "email", "password");
    Transport.send(msg);
    I also passed the following property while creating the session:
    props.put("mail.smtp.auth", "true");
    finally turning on debug helped:
    session.setDebug(true);
    session.setDebugOut(null);
    Hope this helps

  • Error: "javax.mail.MessagingException: 505 5.7.3 Client not Authenticated

    While trying to run a program to sent sms to mobile(with airtel connection)it shows the Error:
    "javax.mail.MessagingException: 505 5.7.3 Client was not Authenticated.
    If anyone knows how to resolve this problem please reply.
    The Code is as follows:
    import java.io.*;
    import java.net.InetAddress;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class EmailSMS
    String TO;
    String FROM;
    String SUBJECT,TEXT,MAILHOST,LASTERROR;
    public static void main(String [] args) throws Exception
         EmailSMS SMS=new EmailSMS();
         SMS.setMailHost("kcsl.com");
         SMS.setTo("[email protected]");
         SMS.setFrom("[email protected]");
         SMS.setSubject("");
         SMS.setText("Hello World");
         boolean ret = SMS.send();
         if(ret){
              System.out.println("SMS was sent");
         else
              System.out.println("SMS was not sent"+SMS.getLastError());
    public EmailSMS()
         TO=null;
         FROM=null;
         SUBJECT=null;
         TEXT=null;
         LASTERROR="No methods calls";
    public void setTo(String to){TO=to;}
    public String getTo(){return TO;}
    public void setFrom (String from){FROM=from;}
    public String getFrom(){ return FROM;}
    public void setSubject(String subject){SUBJECT=subject;}
    public String getSubject(){return SUBJECT;}
    public void setText(String text){TEXT=text;}
    public void setMailHost(String host){MAILHOST=host;}
    public String getMailHost(){return MAILHOST;}
    public String getLastError(){return LASTERROR;}
    public boolean send()
         int maxLength;
         int msgLength;
         //Check to make sure that the parameters are correct
         if(TO.indexOf("mobile.att.net")>0)
              maxLength=140;
         else if(TO.indexOf("messaging.nextel.com")>0)
         {maxLength=280;}
         else if(TO.indexOf("messaging.sprintpcs.com")>0)
         {maxLength=100;}
         else maxLength=160;
         msgLength=FROM.length()+1+SUBJECT.length()+1+TEXT.length();
         if(msgLength>maxLength)
              LASTERROR="SMS length too long";
              return false;
         //set email properties
         Properties props=System.getProperties();
         if(MAILHOST!=null){props.put("mail.smtp.host",MAILHOST);}
         Session session=Session.getDefaultInstance(props,null);
         try{
              Message msg=new MimeMessage(session);
              if(FROM!=null){msg.setFrom(new InternetAddress(FROM));}
              else{msg.setFrom();}
              msg.setSubject(SUBJECT);
              msg.setText(TEXT);
              msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(TO,false));
              msg.setSentDate(new Date());
              Transport.send(msg);
              LASTERROR="Success";
              return true;
         catch(MessagingException max ){LASTERROR=max.getMessage();
         return false;}
    thanku

    Hi,
    it seems to me that you must authenticate with your smtp host. In order to do so, try following:
    While trying to run a program to sent sms to
    mobile(with airtel connection)it shows the Error:
    "javax.mail.MessagingException: 505 5.7.3 Client was
    not Authenticated.
    If anyone knows how to resolve this problem please
    reply.
    The Code is as follows:
    import java.io.*;
    import java.net.InetAddress;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class EmailSMS
    String TO;
    String FROM;
    String SUBJECT,TEXT,MAILHOST,LASTERROR;
    public static void main(String [] args) throws
    Exception
         EmailSMS SMS=new EmailSMS();
         SMS.setMailHost("kcsl.com");
         SMS.setTo("[email protected]");
         SMS.setFrom("[email protected]");
         SMS.setSubject("");
         SMS.setText("Hello World");
         boolean ret = SMS.send();
         if(ret){
              System.out.println("SMS was sent");
         else
    System.out.println("SMS was not
    t sent"+SMS.getLastError());
    public EmailSMS()
         TO=null;
         FROM=null;
         SUBJECT=null;
         TEXT=null;
         LASTERROR="No methods calls";
    public void setTo(String to){TO=to;}
    public String getTo(){return TO;}
    public void setFrom (String from){FROM=from;}
    public String getFrom(){ return FROM;}
    public void setSubject(String
    subject){SUBJECT=subject;}
    public String getSubject(){return SUBJECT;}
    public void setText(String text){TEXT=text;}
    public void setMailHost(String host){MAILHOST=host;}
    public String getMailHost(){return MAILHOST;}
    public String getLastError(){return LASTERROR;}
    public boolean send()
         int maxLength;
         int msgLength;
         //Check to make sure that the parameters are correct
         if(TO.indexOf("mobile.att.net")>0)
              maxLength=140;
         else if(TO.indexOf("messaging.nextel.com")>0)
         {maxLength=280;}
         else if(TO.indexOf("messaging.sprintpcs.com")>0)
         {maxLength=100;}
         else maxLength=160;
         msgLength=FROM.length()+1+SUBJECT.length()+1+TEXT.leng
    h();
         if(msgLength>maxLength)
              LASTERROR="SMS length too long";
              return false;
         //set email properties
         Properties props=System.getProperties();
         if(MAILHOST!=null){props.put("mail.smtp.host",MAILHOST
    Session
    session=Session.getDefaultInstance(props,null);
         try{     // Get a Transport object to send e-mail
                   Transport bus = session.getTransport("smtp");
                   // Connect only once here
                   // Transport.send() disconnects after each send
                   bus.connect(host, username, password);
              Message msg=new MimeMessage(session);
    if(FROM!=null){msg.setFrom(new
    w InternetAddress(FROM));}
              else{msg.setFrom();}
              msg.setSubject(SUBJECT);
              msg.setText(TEXT);
              msg.setRecipients(Message.RecipientType.TO,InternetAd
    ress.parse(TO,false));
              msg.setSentDate(new Date());// Send message
              bus.send(msg);
              bus.close();
              LASTERROR="Success";
              return true;
    catch(MessagingException max
    ){LASTERROR=max.getMessage();
         return false;}
    thankuGood luck

  • Error: Javax.mail does not exist, please help

    I have copies mail.jar and activation.jar in the classpath directory as instructed, then try to compile but got the below error: package javax.mail does not exist
    please help.
    G:\CRD>javac SendMailBean.java
    SendMailBean.java:22: package javax.mail does not exist
    import javax.mail.*; //JavaMail packages
    ^
    SendMailBean.java:23: package javax.mail.internet does not exist
    import javax.mail.internet.*; //JavaMail Internet packages
    ^
    SendMailBean.java:43: cannot resolve symbol
    symbol : class Session
    location: class SendMailBean
    Session l_session = Session.getDefaultInstance(l_props, null);
    ^
    SendMailBean.java:43: cannot resolve symbol
    symbol : variable Session
    location: class SendMailBean
    Session l_session = Session.getDefaultInstance(l_props, null);
    ^
    SendMailBean.java:48: cannot resolve symbol
    symbol : class MimeMessage
    location: class SendMailBean
    MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    ^
    SendMailBean.java:48: cannot resolve symbol
    symbol : class MimeMessage
    location: class SendMailBean
    MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    ^
    SendMailBean.java:50: cannot resolve symbol
    symbol : class InternetAddress
    location: class SendMailBean
    l_msg.setFrom(new InternetAddress(p_from)); // Set the From address
    ^
    SendMailBean.java:53: package Message does not exist
    l_msg.setRecipients(Message.RecipientType.TO,
    ^
    SendMailBean.java:54: cannot resolve symbol
    symbol : variable InternetAddress
    location: class SendMailBean
    InternetAddress.parse(p_to, false));
    ^
    SendMailBean.java:57: package Message does not exist
    l_msg.setRecipients(Message.RecipientType.CC,
    ^
    SendMailBean.java:58: cannot resolve symbol
    symbol : variable InternetAddress
    location: class SendMailBean
    InternetAddress.parse(p_cc, false));
    ^
    SendMailBean.java:62: package Message does not exist
    l_msg.setRecipients(Message.RecipientType.BCC,
    ^
    SendMailBean.java:63: cannot resolve symbol
    symbol : variable InternetAddress
    location: class SendMailBean
    InternetAddress.parse(p_bcc, false));
    ^
    SendMailBean.java:68: cannot resolve symbol
    symbol : class MimeBodyPart
    location: class SendMailBean
    MimeBodyPart l_mbp = new MimeBodyPart();
    ^
    SendMailBean.java:68: cannot resolve symbol
    symbol : class MimeBodyPart
    location: class SendMailBean
    MimeBodyPart l_mbp = new MimeBodyPart();
    ^
    SendMailBean.java:72: cannot resolve symbol
    symbol : class Multipart
    location: class SendMailBean
    Multipart l_mp = new MimeMultipart();
    ^
    SendMailBean.java:72: cannot resolve symbol
    symbol : class MimeMultipart
    location: class SendMailBean
    Multipart l_mp = new MimeMultipart();
    ^
    SendMailBean.java:83: cannot resolve symbol
    symbol : variable Transport
    location: class SendMailBean
    Transport.send(l_msg);
    ^
    SendMailBean.java:98: cannot resolve symbol
    symbol : class MessagingException
    location: class SendMailBean
    } catch (MessagingException mex) { // Trap the MessagingException Error
    ^
    19 errors

    Another person who doesn't understand how to set CLASSPATH.
    Move those JARs into the same directory as your SendMailBean.java and do it like this:
    javac -classpath .;mail.jar;activation.jar -d . *.java
    java -classpath .;mail.jar;activation.jar SendMailBeanRead how to set CLASSPATH properly:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html

  • Error javax.mail.NoSuchProviderException: pop3

    When my application runs within JBuilder everything works fine. But with a native executable I get the following error: javax.mail.NoSuchProviderException: pop3.
    The Dependencies property for JavaMail=Include Dependencies. When set to Include All the native executable not even starts.
    What is wrong here?
    Greetings,
    Hans

    I had some difficulty looking for a solution to this problem.
    All solutions 'beat about the same bush' but I couldnt get any of them to work.
    My advice is dont give up- the problem will eventually be resolved.
    How I resolved it was to assume, ( rightly) that when working inside JBuilder, it is not using the machine classpath to find library files such as mail.jar, but looking at its own library of jar files to find mail.jar.
    I tracked down the JBuilder mail.jar in the /lib dir and copied out all classes beginning with POP... also all non Class files eg proviider and map files , the mailcap file and all files beginning with SUN, and also the Manifest file and placed them in a separate folder on the hard drive.
    I then made an application jar definition from my JBuilder application but told it NOT to make a manifest file.I then right clicked on the build file, and selected properties/content and added in all files from the directory that I previously made containing the files mentioned above.
    To the Manifest file in that directory I also added the mine Main Class: to tell it where my main class was.
    I then re-built the executable jar file.
    It worked. Just when I was down to pulling out the last tuft of hair.
    Message was edited by:
    1straybullet

  • Wanna download javax.mail.* and javax.mail.internet.*

    Hi all;
    i'm a beginner in JSP and want help in downloading api classes for javax.mail.* and javax.mail.internet.*...would any1 like to tell me the URL for it and also after downloading, wat sequence would i follow to make these files run properly with my code.
    would b waiting desperately for immediate response.
    Regards.

    Go to
    http://java.sun.com
    There are 5 drop List. Under the 2nd Drop List Search for JavaMail(TM) API 1.3. Now continue to download. U will download a file names javamail-1_3.zip. There are some jar files which u need to extract and add to ur classpath settings.
    Not use the following code to send a simple SMTP Mail.
    //Java specific imports
    import javax.activation.FileDataSource;
    import javax.activation.DataHandler;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class SendMail
    Session session = null;
    public SendMail() throws Exception
    Properties props = new Properties();
    String strMailIPServer = "Your SMTP Server IP";
    props.put("mail.smtp.host", strMailIPServer);
    session = Session.getDefaultInstance(props, null);
    public void sendMail(String strToAddress, String strFromAddress, String strSubject, String strMessage) throws Exception
    try
    long intTimeForTenMinutes = 60;
         MimeMessage objMimeMsg = new MimeMessage(session);
    //Address objFromAddr = new InternetAddress(strFromAddress);
    javax.mail.internet.InternetAddress objFromAddr = new javax.mail.internet.InternetAddress (strFromAddress);
    Address[] objToAddr = InternetAddress.parse(strToAddress);
    objMimeMsg.setFrom(objFromAddr);
    objMimeMsg.setRecipients(Message.RecipientType.TO, objToAddr);
    objMimeMsg.setSubject(strSubject);
    objMimeMsg.setContent(strMessage, "text/html");
    Transport.send(objMimeMsg);
    catch (Exception mex)
    throw mex;
    All the Best!
    Thanks and regards,
    Pazhanikanthan. P

  • SOAP and javax.mail.internet.ContentType

    Hi there,
    I have a problem with a very simple SOAP app:
    I get a saaj error "Unable to internalize message", which gets caused by a
    NoClassDefFoundError: javax/mail/internet/ContentTypeI have tried everything:
    1) Copied mail.jar to ./jre/lib/ext
    2) Added the directory containing mail.jar to the CLASSPATH, in Windoze and in Sun ONE Studio
    When I try to instantiate javax.mail.internet.ContentType in the same app, it works fine, i.e. the class can be found, but saaj doesn't see it for some strange reason.
    Any ideas?
    I am using the Web Services pack 1.3 and java version:
    java version "1.4.1_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
    Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)Thanks in advance
    Andi

    You also need to have the Java Activation Framework available (activation.jar).
    The NoClassDefFoundErr can me caused by a class being used by a class not being found.

Maybe you are looking for

  • Need solution for Requirements

    Hi All, I am very new to Adobe and need to know if Adobe LiveCycle can solve my problem. I need to create a PDF based electronic form for entering data in a pre-defined format. Once data is filled, the utility should generate a report in a pre-define

  • Input help

    Hi all. I got this working code in selection screen. How can i convert this to a dialog screen? This code is for input help. REPORT  ZGARY_SEARCH_HELP. Data : Begin of li_address, STRAS type ZSTUDGARY-ADMINOGARY, ORT01 type ZSTUDGARY-FNAMEGARY, ORT02

  • Kernel Panic When Installing OS X

    Hey everybody.. I have a strange Problem with my Mac Pro (1st revision).. if I try to install Leopard (or even Tiger from my old system disc) I get to the point where the Apple Logo shows up with lots of spinning going on underneath it.. then, the cr

  • Creating crosshairs for a game

    i am a student and very new to flash, i am creating a shooter game for my class i made a set of crosshairs and i set my enemies to disappear when i click on them and everything works fine but i noticed that my crosshairs don't line up to where i am c

  • Will I really need a new Mac or will all iphone, iPad updates be cloud based?

    Our iMac is almost 6 years old and cannot be upgraded to Lion. I will need to somehow update our iPads and iPhones with a new Mac...or will I? I figure I have 4-8 months with w Leopard before my update days are over with my iMac....then what? We almo