I'm getting an exception while sending a mail . .

i'm get an excpetion while sending a mail, example i'm getting
this particular error
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
at MailTest.<init>(MailTest.java:25)
at MailTest.main(MailTest.java:42)
this is my code
pls help me out
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import javax.naming.Context;
import javax.naming.InitialContext;
public class MailTest
     String mailHost = "mail.business-functions.com";
     String to = "[email protected]";
     String from = "[email protected]";
     String subject = "This is Test Mail Thru Java Mail API";
     String body = "This is Test Mail to check whether the Java Mail APi is Working or not. This is prototype developed by Snehal K gandhi of Business Functions Software Solutions Pvt Ltd.";
     Provider provider;
     public MailTest()
          try
               Properties props = System.getProperties();
               props.put("mail.smtp.host", mailHost);
               Session session = Session.getInstance(props,null);
               Message message = new MimeMessage(session);
               message.setFrom(new InternetAddress(from));
               message.setRecipients(Message.RecipientType.TO,new InternetAddress[]{new InternetAddress(to)});
               message.setSubject(subject);
               message.setContent(body, "text/plain");
               Transport.send(message);
               System.out.println("Mail has been Sent");
          catch(MessagingException me)
               System.out.println("2. Error While Sending the Mail and the exception is : " + me.toString());
     public static void main(String arg[])
          new MailTest();
***********************************************************************/

<sigh>
You need activation.jar in your classpath and or
import javax.activation.*;
See the JavaMail Readme for more info.
If you haven't got JAF get it here
http://java.sun.com/products/javabeans/glasgow/jaf.html
Rgds,
SH

Similar Messages

  • Getting following exception while running coherence tutorial using JDev

    Hi,
    I am getting following exception while running the Oracle Coherence tutorial in Jdeveloper, but unfortunately I'm not able to figure out what's wrong with my configuration.
    Any help will be highly appreciated,
    D:\OracleSOA\Middleware\jdk160_24\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\KnowledgeSOA\.adf;C:\JDeveloper\mywork\KnowledgeSOA\JPA\classes;D:\OracleSOA\Middleware\modules\com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar;D:\OracleSOA\Middleware\modules\org.eclipse.persistence_1.1.0.0_2-1.jar;D:\OracleSOA\Middleware\modules\com.bea.core.antlr.runtime_2.7.7.jar;D:\OracleSOA\Middleware\modules\javax.persistence_1.0.0.0_2-0-0.jar;D:\OracleSOA\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;D:\OracleSOA\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;D:\OracleSOA\Middleware\modules\javax.jsf_1.1.0.0_1-2.jar;D:\OracleSOA\Middleware\modules\javax.ejb_3.0.1.jar;D:\OracleSOA\Middleware\modules\javax.enterprise.deploy_1.2.jar;D:\OracleSOA\Middleware\modules\javax.interceptor_1.0.jar;D:\OracleSOA\Middleware\modules\javax.jms_1.1.1.jar;D:\OracleSOA\Middleware\modules\javax.jsp_1.2.0.0_2-1.jar;D:\OracleSOA\Middleware\modules\javax.jws_2.0.jar;D:\OracleSOA\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;D:\OracleSOA\Middleware\modules\javax.mail_1.1.0.0_1-4-1.jar;D:\OracleSOA\Middleware\modules\javax.xml.soap_1.3.1.0.jar;D:\OracleSOA\Middleware\modules\javax.xml.rpc_1.2.1.jar;D:\OracleSOA\Middleware\modules\javax.xml.ws_2.1.1.jar;D:\OracleSOA\Middleware\modules\javax.management.j2ee_1.0.jar;D:\OracleSOA\Middleware\modules\javax.resource_1.5.1.jar;D:\OracleSOA\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;D:\OracleSOA\Middleware\modules\javax.transaction_1.0.0.0_1-1.jar;D:\OracleSOA\Middleware\modules\javax.xml.stream_1.1.1.0.jar;D:\OracleSOA\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;D:\OracleSOA\Middleware\modules\javax.xml.registry_1.0.0.0_1-0.jar;D:\OracleSOA\Middleware\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;D:\OracleSOA\Middleware\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;D:\OracleSOA\Middleware\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;D:\OracleSOA\Middleware\oracle_common\modules\oracle.dms_11.1.1\dms.jar;D:\Coherence\toplink\jlib\eclipselink.jar;D:\Coherence\coherence-java-3.7.1.0b27797\coherence\lib\coherence.jar;D:\Oracle\Middleware\modules\javax.persistence_1.0.0.0_1-0-2.jar;D:\Coherence\coherence-java-3.7.1.0b27797\coherence\lib\coherence-jpa.jar;D:\Coherence\ojdbc5.jar;D:\Coherence\toplink\jlib\toplink.jar -Djavax.net.ssl.trustStore=D:\OracleSOA\Middleware\wlserver_10.3\server\lib\DemoTrust.jks -Dhttp.proxyHost=proxymlz.samba.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=scms.*|*.contoso.com|ldrps.*|col.wls.*|desu*|tdlintra.*|10.8.*|10.10.*|*.corp.samba.com|ckcexch1*|whoexch1*|lhoexch1*|ehoexch1*|cmzexch2*|choexch2*|cdcstg2.*|itr2.samba.com|itr.samba.com|*.session.rservices.com|cold.samba.com|sims.samba.com|intranet.samba.com|localhost|localhost.localdomain|127.0.0.1|::1|crgmz01bssu-006.corp.samba.com|crgmz01bssu-006 -Dhttps.proxyHost=proxymlz.samba.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=scms.*|*.contoso.com|ldrps.*|col.wls.*|desu*|tdlintra.*|10.8.*|10.10.*|*.corp.samba.com|ckcexch1*|whoexch1*|lhoexch1*|ehoexch1*|cmzexch2*|choexch2*|cdcstg2.*|itr2.samba.com|itr.samba.com|*.session.rservices.com|cold.samba.com|sims.samba.com|intranet.samba.com|localhost|localhost.localdomain|127.0.0.1|::1|crgmz01bssu-006.corp.samba.com|crgmz01bssu-006 -Dtangosol.coherence.cacheconfig=C:\JDeveloper\mywork\KnowledgeSOA\JPA\jpa-cache-config.xml -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.log.level=3 com.samba.coherence.RunEmployee
    2012-08-12 13:36:48.447/0.265 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/D:/Coherence/coherence-java-3.7.1.0b27797/coherence/lib/coherence.jar!/tangosol-coherence.xml"
    2012-08-12 13:36:48.479/0.297 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/D:/Coherence/coherence-java-3.7.1.0b27797/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    Oracle Coherence Version 3.7.1.0 Build 27797
    Grid Edition: Development mode
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    2012-08-12 13:36:48.603/0.421 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/JDeveloper/mywork/KnowledgeSOA/JPA/jpa-cache-config.xml"; this document does not refer to any schema definition and has not been validated.
    2012-08-12 13:36:49.290/1.108 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): This Member(Id=3, Timestamp=2012-08-12 13:36:49.118, Address=10.10.51.150:8090, MachineId=30889, Location=site:,machine:crgmz01bssu-006,process:4816, Role=SambaCoherenceRunEmployee, Edition=Grid Edition, Mode=Development, CpuCount=4, SocketCount=4) joined cluster "cluster:0xFCDB" with senior Member(Id=1, Timestamp=2012-08-12 13:31:01.774, Address=10.10.51.150:8088, MachineId=30889, Location=site:,machine:crgmz01bssu-006,process:4812, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=4, SocketCount=4)
    2012-08-12 13:36:49.305/1.123 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=n/a): Started cluster Name=cluster:0xFCDB
    Group{Address=224.3.7.0, Port=37000, TTL=4}
    MasterMemberSet(
    ThisMember=Member(Id=3, Timestamp=2012-08-12 13:36:49.118, Address=10.10.51.150:8090, MachineId=30889, Location=site:,machine:crgmz01bssu-006,process:4816, Role=SambaCoherenceRunEmployee)
    OldestMember=Member(Id=1, Timestamp=2012-08-12 13:31:01.774, Address=10.10.51.150:8088, MachineId=30889, Location=site:,machine:crgmz01bssu-006,process:4812, Role=CoherenceServer)
    ActualMemberSet=MemberSet(Size=2
    Member(Id=1, Timestamp=2012-08-12 13:31:01.774, Address=10.10.51.150:8088, MachineId=30889, Location=site:,machine:crgmz01bssu-006,process:4812, Role=CoherenceServer)
    Member(Id=3, Timestamp=2012-08-12 13:36:49.118, Address=10.10.51.150:8090, MachineId=30889, Location=site:,machine:crgmz01bssu-006,process:4816, Role=SambaCoherenceRunEmployee)
    MemberId|ServiceVersion|ServiceJoined|MemberState
    1|3.7.1|2012-08-12 13:31:01.774|JOINED,
    3|3.7.1|2012-08-12 13:36:49.305|JOINED
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0
    TcpRing{Connections=[1]}
    IpMonitor{AddressListSize=0}
    Exception in thread "main" (Wrapped) java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList; local class incompatible: stream classdesc serialVersionUID = 4038061360325736360, local class serialVersionUID = -494763524358427112
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterFromBinary.convert(PartitionedCache.CDB:4)
         at com.tangosol.util.ConverterCollections$ConverterMap.get(ConverterCollections.java:1655)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.get(PartitionedCache.CDB:1)
         at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB:1)
         at com.samba.coherence.RunEmployee.main(RunEmployee.java:17)
    Caused by: java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList; local class incompatible: stream classdesc serialVersionUID = 4038061360325736360, local class serialVersionUID = -494763524358427112
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
         at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2217)
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2348)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2746)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:262)
         ... 5 more
    Process exited with exit code 1.
    My Cache-Config file
    <?xml version="1.0" encoding="windows-1252" ?>
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <!-- Set the name of the cache to be the entity name -->
    <cache-name>Employees</cache-name>
    <!-- Configure this cache to use the scheme defined below -->
    <scheme-name>jpa-distributed</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>jpa-distributed</scheme-name>
    <service-name>JpaDistributedCache</service-name>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <!--
    Define the cache scheme
    -->
    <internal-cache-scheme>
    <local-scheme/>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <class-name>com.tangosol.coherence.jpa.JpaCacheStore</class-name>
    <init-params>
    <!--
    This param is the entity name
    This param is the fully qualified entity class
    This param should match the value of the
    persistence unit name in persistence.xml
    -->
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>{cache-name}</param-value>
    </init-param>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>com.samba.coherence.{cache-name}</param-value>
    </init-param>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>JPA</param-value>
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    <autostart>true</autostart>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    cache-server.cmd
    @echo off
    @rem This will start a cache server
    setlocal
    :config
    @rem specify the Coherence installation directory
    set coherence_home=D:\Coherence\coherence-java-3.7.1.0b27797\coherence
    @rem specify the JVM heap size
    set memory=512m
    :start
    if not exist "%coherence_home%\lib\coherence.jar" goto instructions
    if "%java_home%"=="" (set java_exec=java) else (set java_exec=%java_home%\bin\java)
    :launch
    if "%1"=="-jmx" (
         set jmxproperties=-Dcom.sun.management.jmxremote -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true
         shift
    set java_opts=-Xms%memory% -Xmx%memory% %jmxproperties% -Dtangosol.coherence.cacheconfig=C:\JDeveloper\mywork\KnowledgeSOA\JPA\jpa-cache-config.xml
    %java_exec% -server -showversion %java_opts% -cp "%coherence_home%\lib\coherence.jar;C:\JDeveloper\mywork\KnowledgeSOA\JPA\classes;D:\Coherence\coherence-java-3.7.1.0b27797\coherence\lib\coherence-jpa.jar;D:\Coherence\ojdbc5.jar;D:\Coherence\toplink\jlib\eclipselink.jar;D:\Oracle\Middleware\modules\javax.persistence_1.0.0.0_1-0-2.jar" com.tangosol.net.DefaultCacheServer %1
    goto exit
    :instructions
    echo Usage:
    echo ^<coherence_home^>\bin\cache-server.cmd
    goto exit
    :exit
    endlocal
    @echo on
    Many Thanks in Advance
    Zia

    Hi Zia,
    The error is...
    Caused by: java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList; local class incompatible: stream classdesc serialVersionUID = 4038061360325736360, local class serialVersionUID = -494763524358427112
    ...which means you have two different versions of org.eclipse.persistence.indirection.IndirectList, one on the server and one in the client (JDeveloper). As these classes have different serialVersionUID values then Java throws an exception when deserializing as they are probably not compatible.
    I don't know much about the Eclipse stuff but from looking at your post I can only assume one version of the class is in D:\Coherence\toplink\jlib\eclipselink.jar on the Coherence server side and the other is in JDevloper in D:\OracleSOA\Middleware\modules\org.eclipse.persistence_1.1.0.0_2-1.jar as these are the only jar file containing "eclipse" that I can see on the classpaths.
    JK

  • Blind copy while sending a mail...

    Hi Friends,
    How to set a recipient under the blind copy recipient list (BCC) while sending a mail using the function module SO_DOCUMENT_SEND_API1. I have checked the flag <b>blind_copy</b> but not seeing that recipient under the bcc list. Some body please help in this.
    Thanx in advance.
    Ram

    See the example program :
    TABLES: SOLI.
       Data Declarations
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: SAPID     RADIOBUTTON GROUP ADDR,
                EMAIL_ID  RADIOBUTTON GROUP ADDR.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS: ID  FOR SOLI-LINE NO INTERVALS.
    SELECT-OPTIONS: CC  FOR SOLI-LINE NO INTERVALS.
    SELECT-OPTIONS: BCC FOR SOLI-LINE NO INTERVALS.
    *PARAMETERS:     SENDER LIKE SOUD-USRNAM.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-009.
    PARAMETERS: SUB_LINE(60) TYPE C.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-008.
    SELECT-OPTIONS:  TEXT1 FOR SOLI-LINE NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK B4.
    SELECTION-SCREEN BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT-009.
    SELECTION-SCREEN BEGIN OF LINE.
    parameters: P_ATTACH as checkbox.
    selection-screen comment 3(30) text-010.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B5.
    DATA: MAIL_CONTENT LIKE SOLI OCCURS 0 WITH HEADER LINE,
          SUBJECT_LINE LIKE SOOD1-OBJDES.
       Start of program processing
    START-OF-SELECTION.
    Get the Body of the Message from the selection screen or from
    calling program
      LOOP AT TEXT1.
        MOVE   TEXT1-LOW TO MAIL_CONTENT-LINE.
        APPEND MAIL_CONTENT.
      ENDLOOP.
    Subject of the Message
      MOVE  SUB_LINE TO SUBJECT_LINE.
    call a routine to send the workflow message
      PERFORM SEND_EMAIL
              TABLES MAIL_CONTENT
              USING  SUBJECT_LINE.
    *&      Form  SEND_EMAIL
    Send Workflow message
    FORM SEND_EMAIL TABLES OBJCONT STRUCTURE MAIL_CONTENT
                    USING  TITLE   LIKE SOOD-OBJDES.
      DATA: RECEIVERS LIKE SOOS1 OCCURS 0 WITH HEADER LINE,
            TSOOD1 LIKE SOOD1,
            PACKING_LIST LIKE SOXPL OCCURS 0 WITH HEADER LINE,
            OBJCONT1 LIKE MAIL_CONTENT OCCURS 0 WITH HEADER LINE.
      DATA: BEGIN OF AT_HEADER OCCURS 1.
              INCLUDE STRUCTURE SOLI.
      DATA: END OF AT_HEADER.
      CLEAR: TSOOD1,
             RECEIVERS.
      REFRESH RECEIVERS.
      MOVE:  SY-LANGU       TO TSOOD1-OBJLA,
             'Email Notice' TO TSOOD1-OBJNAM,
             'C'            TO TSOOD1-OBJSNS,
             TITLE          TO TSOOD1-OBJDES.
           'SCHIAVONIR'   TO TSOOD1-OWNNAM.
    loop through each ID and move them to recipient table
      LOOP AT ID.
        TRANSLATE ID-LOW TO UPPER CASE.
        IF SAPID = 'X'.
          MOVE: SY-DATUM     TO RECEIVERS-RCDAT,
                SY-UZEIT     TO RECEIVERS-RCTIM,
                ' '          TO RECEIVERS-RECESC,
                 ID-LOW      TO RECEIVERS-RECNAM,
                'X'          TO RECEIVERS-SNDEX.
        ELSE.
          MOVE: SY-DATUM     TO RECEIVERS-RCDAT,
                SY-UZEIT     TO RECEIVERS-RCTIM,
                'U'          TO RECEIVERS-RECESC,
                'U-'         TO RECEIVERS-RECNAM,
                ID-LOW       TO RECEIVERS-RECEXTNAM.
        ENDIF.
        APPEND RECEIVERS.
        CLEAR RECEIVERS.
      ENDLOOP.
    loop through each CC and move them to recipient table
      LOOP AT CC.
        TRANSLATE CC-LOW TO UPPER CASE.
        IF SAPID = 'X'.
          MOVE: SY-DATUM     TO RECEIVERS-RCDAT,
                SY-UZEIT     TO RECEIVERS-RCTIM,
                ' '          TO RECEIVERS-RECESC,
                 CC-LOW      TO RECEIVERS-RECNAM,
                'X'          TO RECEIVERS-SNDEX,
                'X'          TO RECEIVERS-SNDCP.
        ELSE.
          MOVE: SY-DATUM     TO RECEIVERS-RCDAT,
                SY-UZEIT     TO RECEIVERS-RCTIM,
                'U'          TO RECEIVERS-RECESC,
                'U-'         TO RECEIVERS-RECNAM,
                CC-LOW       TO RECEIVERS-RECEXTNAM,
                'X'          TO RECEIVERS-SNDCP.
        ENDIF.
        APPEND RECEIVERS.
        CLEAR RECEIVERS.
      ENDLOOP.
    loop through each BCC and move them to recipient table
      LOOP AT BCC.
        TRANSLATE BCC-LOW TO UPPER CASE.
        IF SAPID = 'X'.
          MOVE: SY-DATUM     TO RECEIVERS-RCDAT,
                SY-UZEIT     TO RECEIVERS-RCTIM,
                ' '          TO RECEIVERS-RECESC,
                 BCC-LOW     TO RECEIVERS-RECNAM,
                'X'          TO RECEIVERS-SNDEX,
                'X'          TO RECEIVERS-SNDBC.
        ELSE.
          MOVE: SY-DATUM     TO RECEIVERS-RCDAT,
                SY-UZEIT     TO RECEIVERS-RCTIM,
                'U'          TO RECEIVERS-RECESC,
                'U-'         TO RECEIVERS-RECNAM,
                BCC-LOW      TO RECEIVERS-RECEXTNAM,
                'X'          TO RECEIVERS-SNDBC.
        ENDIF.
        APPEND RECEIVERS.
        CLEAR RECEIVERS.
      ENDLOOP.
      AT_HEADER = SY-DATUM.
      APPEND AT_HEADER.
      AT_HEADER = SY-UZEIT.
      APPEND AT_HEADER.
    IF SENDER EQ SPACE.
       SENDER = SY-UNAME.
    ENDIF.
      IF P_ATTACH EQ 'X'.
        PACKING_LIST-HEAD_START = 1.
        PACKING_LIST-HEAD_NUM   = 2.
        PACKING_LIST-BODY_START = 1.
        PACKING_LIST-BODY_NUM   = 9999.
        PACKING_LIST-FILE_EXT   = 'TXT'.
        APPEND PACKING_LIST.
        CLEAR  PACKING_LIST.
        APPEND LINES OF OBJCONT TO OBJCONT1.
        REFRESH OBJCONT.
      ENDIF.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                OBJECT_HD_CHANGE           = TSOOD1
                OBJECT_TYPE                = 'RAW'
           TABLES
                OBJCONT                    = OBJCONT
                RECEIVERS                  = RECEIVERS
                ATT_HEAD                   = AT_HEADER
                ATT_CONT                   = OBJCONT1
                PACKING_LIST               = PACKING_LIST
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                FOLDER_NOT_EXIST           = 4
                FOLDER_NO_AUTHORIZATION    = 5
                FORWARDER_NOT_EXIST        = 6
                NOTE_NOT_EXIST             = 7
                OBJECT_NOT_EXIST           = 8
                OBJECT_NOT_SENT            = 9
                OBJECT_NO_AUTHORIZATION    = 10
                OBJECT_TYPE_NOT_EXIST      = 11
                OPERATION_NO_AUTHORIZATION = 12
                OWNER_NOT_EXIST            = 13
                PARAMETER_ERROR            = 14
                SUBSTITUTE_NOT_ACTIVE      = 15
                SUBSTITUTE_NOT_DEFINED     = 16
                SYSTEM_FAILURE             = 17
                TOO_MUCH_RECEIVERS         = 18
                USER_NOT_EXIST             = 19
                X_ERROR                    = 20
                OTHERS                     = 21.
    ENDFORM.                               " SEND_EMAIL
    text elements
    BCC     Blind CC
    CC     Copy to
    EMAIL_ID     Email ID
    ID     ?...
    P_ATTACH     Send as Attachment?
    SAPID     SAP ID
    SUB_LINE     Subject
    TEXT1     Message

  • Error in Campaign while sending e-mail

    Hi All,
    I have created the mktg and campaign scenerio and assigning the target group and in segment I hace done segment group to channel. But while sending the mail to the target group for checking the status is having error. Even if I cheked in Tcode SOST the status also coming in error. Can anybody answer me this.
    Second thing I want to maintain budget plan for this. And also I want to create lead from this campaign and to do campaign execution. Any body is having doc can u send it to my mail id at
    [email protected]    or
    [email protected]
    Thanx in Advance
    Saravana

    Hi Saravana,
    For your first question:e-mails ending in error -
    1. Check the communication method used for sending e-mails in the channel settings in your campaign.
    2. Check the scot configuration as whether the host assigned to the SMTP service is public i.e whether can you send the e-mails outside your network.To test this you can do channel test for the e-mail form you created for campaign. If the e-mails are not going out then check with your basis or system admin for the correct ip.
    3. Check what is the error on sost.
    4. Finally check the address in the BP for e-mail.
    Reward points if helpful
    Shridhar

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

  • Getting An Exception while deploying .ear file

    Hi,
    I'm getting the following exception while manual deploying the ear file. Can you please reply the cause.
    java.lang.Exception: Delta :12 ErrorMessage :null
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:524)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    No Exception Messages
    Regards
    Suneel

    java.lang.Exception: Delta :55 ErrorMessage :[Deployer:149233]An unexpected error was encountered during the deployment process.
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:524)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    at java.lang.Thread.startThreadFromVM(Unknown Source)
    No Exception Messages
    Description: [Deployer:149026]Deploy application appname....... on cluster1.
    A description of this task.
    Status: Deploy Failed
    The status of this task.
    Begin Time: Fri Feb 17 10:24:56 EST 2006
    The time this task was started.
    End Time: Fri Feb 17 10:24:59 EST 2006
    The time this task was completed.
    Exception: Delta :55 ErrorMessage :[Deployer:149233]An unexpected error was encountered during the deployment process.
    The exception that occurred while performing this task.
    Log:
    A log of the task's activities.
    [Deployer:149033]preparing application Appname on server1
    [Deployer:149033]preparing application APPName on server2
    [Deployer:149033]failed application Appname on server1
    [Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application AppName on cluster1.: Delta :55 ErrorMessage :[Deployer:149233]An unexpected error was encountered during the deployment process..

  • Getting Servlet Exception while accessing servlets after deployment

    Hi,
    Iam getting a Servlet Exception while accessing servlets after deploying into weblogic 8.1
    Error 500--Internal Server Error
    javax.servlet.ServletException: [HTTP:101249][ServletContext(id=9599010,name=MyWeb,context-path=)]: Servlet class LoginServlet for servlet LoginServlet could not be loaded because the requested class was not found in the classpath F:\bea\weblogic81\samples\domains\examples\MyWeb\WEB-INF\classes;F:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_MyWeb_MyWeb.
    java.lang.UnsupportedClassVersionError: LoginServlet (Unsupported major.minor version 49.0).
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:834)
         at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:535)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:373)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    My Folder Structureis like this,
    F:\bea\weblogic81\samples\domains\examples\MyWeb
    MyWeb is the projectName
    F:\bea\weblogic81\samples\domains\examples\MyWeb\WEB-INF
    Inside WEB-INF, i have web.xml and weblogic.xml, and classes directory with servlet classes.
    Any help will be appreciated.
    Thanx in advance.
    Regards
    Ram

    Hi,
    Thanks for the reply.
    Yes you are correct, i compiled using jdk1.5.
    but my servlet code will not compile in jdk1.4 version since i used advanced vaector classes in that.
    Is there any settings like script file that need to be changed so that i can point to my jdk1.5 compiler rather than the default one pointed by weblogic.
    Thanks in advance
    Ram

  • Exception while sending mail using javamail

    below i am using the code to send a mail to [email protected]
    but it is giving exception
    "class com.sun.mail.smtp.SMTPSendFailedException: 554 <[email protected]>: Recipient address rejected: Relay access denied"
    please can any body help me to solve this problem
    Properties props = new Properties();
    props.put("mail.smtp.host", "xxxxxxxxxxxxx");
    Session s = Session.getInstance(props,null);
    MimeMessage message = new MimeMessage(s);
    InternetAddress from = new InternetAddress("[email protected]");
    message.setFrom(from);
    InternetAddress to = new InternetAddress("[email protected]");
    message.addRecipient(Message.RecipientType.TO, to);
    message.setSubject("Test from JavaMail.");
    message.setText("Hello from JavaMail!");
    Transport.send(message);

    I was getting the same error as the others, and I added authentication, but it still gives me the error.
    All "AutomailingUtility" constants are strings
    public class SMTPSender {
    private Session session;
    public SMTPSender() {
    Properties props = new Properties();
    props.setProperty("mail.smtp.host", AutomailingUtility.HOST);
    props.put("mail.smtp.auth", AutomailingUtility.AUTH);
    Authenticator auth = new MyAuthenticator(AutomailingUtility.USERNAME, AutomailingUtility.PASSWORD);
    session = Session.getInstance(props, auth);
    public void sendMessage(String toUser, String message, String subject) {
    try {
    Message msg = new MimeMessage(session);
    msg.setSubject(subject);
    msg.setSentDate(new Date());
    InternetAddress ia = new InternetAddress(AutomailingUtility.FROM_ADDRESS);
    msg.setFrom(ia);
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toUser));
    msg.setText(message);
    Transport.send(msg);
    } catch (AddressException e) {
    e.printStackTrace();
    } catch (MessagingException e) {
    e.printStackTrace();
    any ideas?

  • Classcast exception while sending objects to the server

    I'm getting classcast exception when i try to send objects from the java webstart application at the client side to a server. Its working fine if I do the same without using javaweb start. I'm using hessian client to send objects to the server.
    I've a web app that gets outlook contacts from the client machine and send those to the server. I'm sending these contacts as custom objects(OutlookContact) to the server using hessian client. But these objects are being sent to the server as String objects but not as OutlookContact objects. I don't know whats happening. Can anyone please tell me is there any setting that I need to set in the jnlp file.
    thanks,
    Jayaram

    I am also getting the same error. Please anybody can help

  • Exception while sending json payload

    getting this exception when i send a json payload for auhtentication to a rest service
    Content-Type: application/json {"X-Idaas-Rest-Subject-Type":"USERCREDENTIAL","X-Idaas-Rest-Subject-Username":"weblogic","X-Idaas-Rest-Subject-Password":"weblogic","X-Idaas-Rest-New-Token-Type-To-Create":"USERTOKEN"}
    java exception running circuit: java.lang.NullPointerException at com.vordel.circuit.CircuitActivationProcessor.getGeneratedAttributesFromStack(CircuitActivationProcessor.java:26) at com.vordel.circuit.CircuitActivationProcessor.invoke(CircuitActivationProcessor.java:54) at com.vordel.circuit.InvocationEngine.invokeFilter(InvocationEngine.java:160) at com.vordel.circuit.InvocationEngine.invokeCircuit(InvocationEngine.java:52) at com.vordel.circuit.InvocationEngine.processMessage(InvocationEngine.java:241) at com.vordel.circuit.SyntheticCircuitChainProcessor.invoke(SyntheticCircuitChainProcessor.java:36) at com.vordel.dwe.http.HTTPPlugin.invokeDispose(HTTPPlugin.java:300) at com.vordel.dwe.http.HTTPPlugin.invoke(HTTPPlugin.java:166)

    could you provide the policy flow also.
    From the exception it looks like there is something wrong with the authentication part as if it is not getting the required attributes.

  • Error while sending E-Mail -- 501 Syntax error in parameters or arguments

    Dear Friends,
    I was trying to send E-Mail using the NTLM Authentication mechanism using the below program:
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import javax.mail.PasswordAuthentication;
    import java.util.Date;
    import com.sun.mail.smtp.*;
    public class MailerWithAuthentication
         private String     smtpServer;
         private String      fromEmailId;
         private String      toEmailId;
         private String      ccEmailId;
         private String      bccEmailId;
         private String      subject;
         private String      message;
         private String host;
         public MailerWithAuthentication(String toemail, String msg,String sub,String fromId,String host)
              this.toEmailId = toemail;;
              this.subject = sub;
              this.message = msg;
              this.fromEmailId=fromId;
              this.host=host;
    public void sendMail()
              String mailContent = "";
              try
                   Authenticator authenticator = new Authenticator();
                   Properties props = new Properties();
              props.put("mail.smtp.host",this.host );
              props.put("mail.smtp.port", "25");
              props.put("mail.smtp.auth", "true");
              props.put("mail.smtp.auth.mechanisms", "NTLM");
              props.put("mail.smtp.auth.ntlm.flags", "0x00000200");          
              props.put("mail.smtp.auth.ntlm.domain","sal.ad");
              props.put("mail.debug", "true");
              Session session = Session.getDefaultInstance(props,authenticator);
    Message msg = new MimeMessage(session);          
              MimeMessage message = new MimeMessage(session);
              message.setContent("This is a test", "text/plain");
              message.setFrom(new InternetAddress(this.fromEmailId));
              message.addRecipient(Message.RecipientType.TO,new InternetAddress(this.toEmailId));
              Transport.send(message);
              catch (Exception e)
                   e.printStackTrace();
                   System.out.println("Exception in MailerThread : run: " + e.getMessage());               
    private class Authenticator extends javax.mail.Authenticator {
              private PasswordAuthentication authentication;
              public Authenticator() {
                   String username= "sal.ad\mailuser";
                   String password = "mail@123";          
                   authentication = new PasswordAuthentication(username, password);
              protected PasswordAuthentication getPasswordAuthentication() {
                   return authentication;
    public static void main(String args[])
              try
                   System.out.println(" Usage : java MailerWithAuthentication <To-Email> <Message> <Subject> <From-Email> <Mail-Server-IP>");
                   MailerWithAuthentication mailer = new MailerWithAuthentication (args[0],args[1],args[2],args[3],args[4]);
                   mailer.sendMail();
              catch(Exception e)
                   e.printStackTrace();
    Following is the output while running the program:
    DEBUG: JavaMail version 1.4ea
    DEBUG: java.io.FileNotFoundException: /usr/java/jdk1.5.0_14/jre/lib/javamail.providers (No such file or directory)
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.providers
    DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
    DEBUG: Tables of loaded providers
    DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
    DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
    DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.address.map
    DEBUG: java.io.FileNotFoundException: /usr/java/jdk1.5.0_14/jre/lib/javamail.address.map (No such file or directory)
    Mechanishm = NTLM
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "192.168.14.6", port 25, isSSL false
    220 ****************************************************************************
    DEBUG SMTP: connected to host "192.168.14.6", port: 25
    EHLO
    501 Syntax error in parameters or arguments -
    HELO
    501 Syntax error in parameters or arguments -
    javax.mail.MessagingException: 501 Syntax error in parameters or arguments -
    =================================
    The error is :
    EHLO
    501 Syntax error in parameters or arguments -
    HELO
    501 Syntax error in parameters or arguments -
    =================================
    Please tell me what went wrong here. Is it due to any mistake in the program ?
    Thanks in advance.

    hello Anirudh Pucha,
    thanks for your message,
    i'm downloading all the files you advised and one more doubt regarding SOA installation,
    i'm using BPEL Process manager 10.1.3.1.0 installed on my machine and not installed SOA Suite (problem in installing AS Middle tier), i send voice,sms through BPEL PM which works fine, and faced problem in e-mail notification only, according to me with out installing SOA suite we can use BPEL PM or please let me know the procedure to install the downloading files.
    if possible please send me a details in word documents to my mail "[email protected]".
    Thanks again

  • Error while sending a mail with pdf attachment

    Hai
    I am sending mail with an attachment of PDF document. While sending I am getting
    javax.activation.UnsupportedDataTypeException: application/pdf
    This is my code
    public static void setByteArrayAsAttachment(Message msg, byte[] attach)
    throws MessagingException {
    MimeBodyPart p1 = new MimeBodyPart();
    ByteArrayDataSource byteStr = new ByteArrayDataSource(attach,"application/pdf");
    p1.setContent(byteStr,"application/pdf");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(p1);
    msg.setContent(mp);
    Can one one help me on this...
    Thanks
    Jithesh PM

    Change
    p1.setContent(byteStr,"application/pdf");
    to
    p1.setDataHandler(new DataHandler(byteStr));

  • Problem while sending a mail with smtp and ssl

    Hi all,
    I am new to java mail . I have downloaded one java program to send the mail. I have configured smt and port address.And my System firewall is also in off mode
    Still i am unable to send the mail
    The following code is my program import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.URLName;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import com.sun.mail.smtp.SMTPSSLTransport;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
    //private static final String SMTP_HOST_NAME = "smtp.mail.yahoo.com";
         private static final String SMTP_HOST_NAME = "smtp.gmail.com";
      private static final String SMTP_AUTH_USER = "admijn.ramd";
      private static final String SMTP_AUTH_PWD  = "hairamu";
      private static final int SMTP_PORT  = 465;
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]", "[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
      public void postMail( String recipients[ ], String subject,
                                String message , String from)
           try{
        boolean debug = false;
         //Set the host smtp address
    //  Set the host smtp address
         Properties props = new Properties();
         props.put("mail.transport.protocol", "smtp");
         props.put("mail.smtp.port", SMTP_PORT);
         props.put("mail.smtp.starttls.enable","true");
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         props.put("mail.smtp.auth", "true");
          props.put("mail.smtp.socketFactory.port", SMTP_PORT);
         props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
          props.put("mail.smtp.socketFactory.fallback", "false");
          SecurityManager security = System.getSecurityManager();
         Authenticator auth = new SMTPAuthenticator();
         Session session = Session.getDefaultInstance(props, auth);
         session.setDebug(debug);
         // create a message
         Message msg = new MimeMessage(session);
         // set the from and to address
         InternetAddress addressFrom = new InternetAddress(from);
         msg.setFrom(addressFrom);
         InternetAddress[] addressTo = new InternetAddress[recipients.length];
         for (int i = 0; i < recipients.length; i++) {
              addressTo[i] = new InternetAddress(recipients);
         msg.setRecipients(Message.RecipientType.TO, addressTo);
         // Setting the Subject and Content Type
         msg.setText(message);
         msg.setSubject(subject);
         msg.setContent(message, "text/plain");
         Transport.send(msg);
         }catch (MessagingException e) {
              // TODO: handle exception
              e.printStackTrace();
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
         try{
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    System.out.println("username "+ username+" Password"+password);
    return new PasswordAuthentication(username, password);
         }catch (Exception e) {
         return null;
    And i am getting the following exceptions
    javax.mail.MessagingException: Exception reading response;
      nested exception is:
         javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
         at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611)
         at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
         at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
         at javax.mail.Service.connect(Service.java:310)
         at javax.mail.Service.connect(Service.java:169)
         at javax.mail.Service.connect(Service.java:118)
         at javax.mail.Transport.send0(Transport.java:188)
         at javax.mail.Transport.send(Transport.java:118)
         at com.FutureSoft.org.SendingMail.SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:123)
         at com.FutureSoft.org.SendingMail.SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:70)
    Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
         at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
         at java.io.BufferedInputStream.fill(Unknown Source)
         at java.io.BufferedInputStream.read(Unknown Source)
         at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:88)
         at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1589)
         ... 9 more                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hi neuro11
    the following code is for sending mail its is working fine in my system, just change the
    SMTP_AUTH_USER = "tina.numi"; with u r email user name
    SMTP_AUTH_PWD = "abdcde"; u r gmail password
    emailFromAddress = "[email protected]"; ur gmail addres
    emailList = {"[email protected]"}; receipient list .
    and u must sure that u r internet is on and firewall should be off . some times firewall restricts you to communicate with gmail port number
    Please make u r firewall off and source code is
    package com.FutureSoft.org.SendingMail;
    Some SMTP servers require a username and password authentication before you
    can use their Server for Sending mail. This is most common with couple
    of ISP's who provide SMTP Address to Send Mail.
    This Program gives any example on how to do SMTP Authentication
    (User and Password verification)
    This is a free source code and is provided as it is without any warranties and
    it can be used in any your code for free.
    Author : Sudhir Ancha
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.URLName;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import com.sun.mail.smtp.SMTPSSLTransport;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
    //private static final String SMTP_HOST_NAME = "smtp.mail.yahoo.com";
         private static final String SMTP_HOST_NAME = "smtp.gmail.com";
      private static final String SMTP_AUTH_USER = "tina.numi";// gmail username
      private static final String SMTP_AUTH_PWD  = "abdcde";// gmail password
      private static final int SMTP_PORT  = 465;
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";// gmail id
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
      public void postMail( String recipients[ ], String subject,
                                String message , String from)
           try{
        boolean debug = false;
         //Set the host smtp address
    //  Set the host smtp address
         Properties props = new Properties();
         props.put("mail.transport.protocol", "smtp");
         props.put("mail.smtp.port", SMTP_PORT);
         props.put("mail.smtp.starttls.enable","true");
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         props.put("mail.smtp.auth", "true");
          props.put("mail.smtp.socketFactory.port", SMTP_PORT);
         props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
          props.put("mail.smtp.socketFactory.fallback", "false");
          SecurityManager security = System.getSecurityManager();
         Authenticator auth = new SMTPAuthenticator();
         Session session = Session.getInstance(props, auth);
         session.setDebug(debug);
         // create a message
         Message msg = new MimeMessage(session);
         // set the from and to address
         InternetAddress addressFrom = new InternetAddress(from);
         msg.setFrom(addressFrom);
         InternetAddress[] addressTo = new InternetAddress[recipients.length];
         for (int i = 0; i < recipients.length; i++) {
              addressTo[i] = new InternetAddress(recipients);
         msg.setRecipients(Message.RecipientType.TO, addressTo);
         // Setting the Subject and Content Type
         msg.setText(message);
         msg.setSubject(subject);
         msg.setContent(message, "text/plain");
         Transport t = session.getTransport("smtps");
         try {
              t.connect(SMTP_HOST_NAME, SMTP_AUTH_USER, SMTP_AUTH_PWD);
              t.sendMessage(msg, msg.getAllRecipients());
         catch(Exception e){}
         finally
              t.close();
         }catch (MessagingException e) {
              // TODO: handle exception
              e.printStackTrace();
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
         try{
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    System.out.println("username "+ username+" Password"+password);
    return new PasswordAuthentication(username, password);
         }catch (Exception e) {
         return null;
    try this . all the best

  • Problem  while sending the mail from sap

    Hi experts,
                     I am facing some problem while sending mail from sap to external mail.
    this is th code i am using but it is not working. plz check and tell me.
    REPORT  ZMAIL_DEMO.
    data: maildata type sodocchgi1.
    data: mailtxt type table of solisti1 with header line.
    data: mailrec type table of somlrec90 with header line.
    start-of-selection.
    break-point.
    clear: maildata, mailtxt, mailrec.
    refresh: mailtxt, mailrec.
    maildata-obj_name = 'TEST'.
    maildata-obj_descr = 'Test'.
    maildata-obj_langu = sy-langu.
    mailtxt-line = 'This is a test'.
    append mailtxt.
    mailrec-receiver = 'SOME MAIL ID'.
    mailrec-rec_type = 'U'.
    append mailrec.
    call function 'SO_NEW_DOCUMENT_SEND_API1'
    exporting
    document_data = maildata
    document_type = 'RAW'
    put_in_outbox = 'X'
    tables
    object_header = mailtxt
    object_content = mailtxt
    receivers = mailrec
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    others = 8.
    if sy-subrc = 0.   "( did not receive any mail) *
    write : 'mail sent'.
    endif.

    Hi,
    Please check with the following code.
    TABLES: KNA1.
    data for send function
    DATA DOC_DATA  LIKE SODOCCHGI1.
    DATA OBJECT_ID LIKE SOODK.
    DATA OBJCONT   LIKE SOLI OCCURS 10 WITH HEADER LINE.
    DATA RECEIVER  LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
    SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
      WRITE:/ KNA1-KUNNR, KNA1-ANRED.
    send data internal table
      CONCATENATE KNA1-KUNNR KNA1-ANRED
                             INTO OBJCONT-LINE SEPARATED BY SPACE.
      APPEND OBJCONT.
    ENDSELECT.
    insert receiver (sap name)
      REFRESH RECEIVER.
      CLEAR RECEIVER.
      MOVE: 'any_email'_ TO RECEIVER-RECEIVER,                " SY-UNAME
            'X'      TO RECEIVER-EXPRESS,
            'U'      TO RECEIVER-REC_TYPE.
      APPEND RECEIVER.
    insert mail description
      WRITE 'Sending a mail through abap'
                     TO DOC_DATA-OBJ_DESCR.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA              = DOC_DATA
         IMPORTING
              NEW_OBJECT_ID              = OBJECT_ID
         TABLES
              OBJECT_CONTENT             = OBJCONT
              RECEIVERS                  = RECEIVER
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              DOCUMENT_TYPE_NOT_EXIST    = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR            = 5
              X_ERROR                    = 6
              ENQUEUE_ERROR              = 7
              OTHERS                     = 8.

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

Maybe you are looking for

  • Scroll bar in jsp

    Hi all, I am having a table in jsp. It contains four columns. 1 st and 2 nd row gives the table headings. In first row, i have applied rowspan=2 to first two columns.then for 3rd and 4th column there is no rowspan. in second row, I have given heading

  • External sound console quit working on aud

    i have an audigy 2 zs platinum pro. the external console is model sb0290. one day (and i dont know exactly when) the console quit working. as if it gets no power. i used to be able to turn down the volume from it and one day just noticed it ceases to

  • AppleTV and iPhoto '11 not compatible

    Upgrading to iPhoto '11 has broken the link to my 160GB Apple TV. I can no longer view my iPhoto albums on my Apple TV. When synching with the Apple TV, iTunes gives me an error message telling me that it cannot locate my iPhoto Library. Any ideas on

  • Need to reinstall Acrobat X Pro; part of my CS6 Design?

    Help. Need to reinstall Acrobat X Pro; part of my CS6 Design?

  • Aperture - What it Does

    Today I was given a lovely gift - Aperture! However, I am trying to learn what it does exactly. Can anyone tell me? I do a lot of work with Photoshop and presently keep thousands of images in iPhoto. I also make a lot of videos. I was told Aperture w