Problem while sending mail -Logo not appearing.

Hi,
The requirement  is to  send  a  message as a text  and not as a PDF attachment to a recepient.
( I am converting the smartform code  into HTML format  - I referred to url
/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp which contains the rough code )  and am sending the mail to the
recepient.
The mail is getting generated, the text of the message is getting properly formatted as desired.
But the company logo is not appearing .
I am able to see the logo when I send the mail to my employer's mail  server outlook, but am unable to see
the logo when I send the mail to the customer's mail server in  outlook.
Can anybody suggest what could be going wrong?
Regards,
Girish.

Hi Brad John,
Thank you for your reply.
I tried 2 methods :
1. I attached the logo to the smartform and sent the mail to my employer's mail id and
my customer's mail id.
I am able to get the logo and text in my employer's mail server but in my customer's mail server,
the text and logo are getting split into 2 attachments in the body of the mail
instead I require the text and logo in the body of the mail.
2. I  removed the logo in the smartform and tried typing the url in the smartform window text as suggested in
    URL http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2273. [original link is broken] [original link is broken] [original link is broken]
   The logo does not appear iin my employer's mail server but in my customer's mail server,
   all I get is a text of the URL.
Can you please suggest the possible reason for this problem
The  url of the IMG tag is accessible externall.
What is meant by  drop/reference MIME data in a location that is external to corporate firewall.
Please elaborate.
Many thanks for your time and patience.
Regards,
Girish.

Similar Messages

  • PROBLEM WHILE SENDING MAILS TO MUTILPLE RECIPIENTS

    hi,
    while sending mails to multiple recipients,if any one of the mail id is invalid the mail is not being send to other valid mailids,how can this problem be resolved , so that other than the invalid recipient mail has to be send to other valid mailids

    COULD YOU PLEASE STOP SHOUTING?
    CAN YOU TALK LOUDER, I CAN'T HEAR YOU!

  • Problem while sending mail inOIM 11g r2

    HI,
    i am getting following error while sending mail in OIM 11G r2
    <Jun 13, 2012 12:53:25 AM PDT> <Warning> <oracle.adfinternal.view.faces.renderkit.rich.SelectItemUtils> <ADF_FACES-30118> <No help provider found for helpTopicId=create_user.>
    java.net.MalformedURLException: For input string: "SOA_PORT"
    at java.net.URL.<init>(URL.java:601)
    at java.net.URL.<init>(URL.java:464)
    at java.net.URL.<init>(URL.java:413)
    at java.net.URI.toURL(URI.java:1081)
    at oracle.j2ee.ws.common.transport.HttpTransport.transmit(HttpTransport.java:61)
    at oracle.j2ee.ws.common.async.MessageSender.call(MessageSender.java:64)
    at oracle.j2ee.ws.common.async.Transmitter.transmitSync(Transmitter.java:134)
    at oracle.j2ee.ws.common.async.Transmitter.transmit(Transmitter.java:90)
    at oracle.j2ee.ws.common.async.RequestorImpl.transmit(RequestorImpl.java:273)
    at oracle.j2ee.ws.common.async.RequestorImpl.invoke(RequestorImpl.java:94)
    at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:811)
    at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:235)
    at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:106)
    at oracle.j2ee.ws.client.jaxws.WsClientProxyInvocationHandler.invoke(WsClientProxyInvocationHandler.java:254)
    at $Proxy422.send(Unknown Source)
    But it is known issue in OIM 11gr2 .
    solution is The cause of this error is malformed URL. To resolve the issue, provide the correct values for SOA_PORT and SOA_HOST in Enterprise Manager (EM).
    BUT i didn't find the SOA_PORT,SOA_HOST in EM console.
    Thanks,
    Edited by: 853559 on Sep 20, 2012 3:09 AM

    . Follow the steps mentioned below to configure the workflow notification properties:
    •     Login to EM console as weblogic user.
    •     Expand SOA.
    •     Right click on <soa-infra> ANY ONE WILL BE REFLECTED. Select SOA Administration --> Workflow notification properties
    •     Select "Email" from “Notification Mode” list
    •     Provide notification service field values as:
    o     Email : From Address * : [email protected]
    o     Email : Actionable Address : [email protected]
    o     Email : Reply To Address: [email protected]
    •     Click Apply
    •     Click "Go to the Messaging Driver page" link
    •     Select configure driver: Provide Driver-Specific Configuration as:
    o     MailAccessProtocol : IMAP
    o     ReceiveFolder : INBOX
    o     OutgoingMailServer : smtp.sample.com
    o     OutgoingMailServerPort : 25
    o     OutgoingDefaultFromAddress : [email protected]
    •     Click Apply
    If you are sending mail through xelsysadm account then change the value of “Email” field of that account .
    Also configure Email Server ITResource .
    Edited by: IAM_TECH on Sep 20, 2012 3:48 PM

  • Problem while sending mail from SAP

    Hi ABAP gurus,
        I tried to send mail from SAP. For this we configured SMTP Services using the transaction SCOT and all are Completed.
      When I send a mail using SAPOffice it is Executing successfully and main is delivered to me.
       When I tried in  the program using the function module 'SO_NEW_DOCUMENT_SEND_API1' mail is not delivered to me but it is placed in SAPoffice outbox.The status of the mail says  "SEND PROCESS STILL RUNNING". Even when i execute SAPconnect manually mail is not transmitted.
       This is the transaction history of the mail.
      Trans. history  
    18.02.2006  13:44:31  Document sent 
                 13:44:31  Wait for communications service 
    After This stage Delivery attempt is not taking place.
    This is the Code
    ****Document DATA
    EMAIL_DATA-OBJ_NAME = 'MESSAGE'.
    EMAIL_DATA-OBJ_DESCR = SUBJECT.
    EMAIL_DATA-OBJ_LANGU = 'E'.
    EMAIL_DATA-SENSITIVTY = 'P'.
    EMAIL_DATA-OBJ_PRIO =  '1'.
    EMAIL_DATA-NO_CHANGE = 'X'.
    EMAIL_DATA-PRIORITY = '1'.
    ***Receiver
        EMAIL_SEND-RECEIVER = '[email protected]'.
        EMAIL_SEND-REC_TYPE = 'U'.
        EMAIL_SEND-EXPRESS = 'X'.
        APPEND EMAIL_SEND.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA              = EMAIL_DATA
              DOCUMENT_TYPE              = 'RAW'
              PUT_IN_OUTBOX              = 'X'
        IMPORTING
             SENT_TO_ALL                = SENT
             NEW_OBJECT_ID              = EMAIL_ID
         TABLES
              OBJECT_CONTENT             = EMAIL_TEXT
              RECEIVERS                  = EMAIL_SEND
         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.
    Please Help me to solve this Problem.
    Regards,
    Viswanath Babu.P.D

    Hi viswanath,
    1. in scot, in smtp node,
    2. press the internet button
    3. In ADDRESS AREA,
       type
       *yahoo.com
       *rediffmail.com
      etc,etc.
    4. Only when such domains are  entered,
       will sap send mail.
    5. It will not send any mail to other domains.
    6. Or simply enter *
    regards,
    amit m.

  • Problem while sending mail - wrapped text

    Hi,
    I'm sending mail with .doc attachment file using FM SO_NEW_DOCUMENT_ATT_SEND_API1 and I'm getting the mail with the attachment. But it's not in the same format what I see in the spool. It gets word wrapped which is not of my interest.
    Also I tried for a PDF attachment but it says it's not supported. I'm able to get DOC but not PDF. For my requirement it's better if I get the PDF format. Any body can help?????

    Hi,
    You can convert the Spool to PDF format and use the fun module SO_NEW_DOCUMENT_ATT_SEND_API1 to send to mail, the output will be of PDF format.
    see the sample code:
      INCLUDE ZINCUSMAIL                                                 *
    include <symbol>.
    data : i_doc_data like sodocchgi1.
    data : begin of i_pack_list occurs 0.
            include structure sopcklsti1.
    data : end of i_pack_list.
    data : begin of i_receivers occurs 0.
            include structure somlreci1.
    data : end of i_receivers.
    data : begin of i_contents occurs 0.
            include structure solisti1.
    data : end of i_contents.
    data : begin of i_header occurs 0.
            include structure solisti1.
    data : end of i_header.
    data : begin of i_att occurs 0.
            include structure solisti1.
    data : end of i_att.
    Internal Table for Internet address.
    data: begin of it_inad occurs 0,
            kunnr like kna1-kunnr,           " Customer Code
            name1 like kna1-name1,           " Customer Name
            ssobl like knkk-ssobl,           " Security Deposit
            klimk like knkk-klimk,           " Credit Limit
            opbal like bsid-wrbtr,           " Opening Balance
            clbal like bsid-wrbtr,           " Closing Balance
            smtp  like adr6-smtp_addr,       " Internet mail (SMTP) address
          end of it_inad.
    data : pdf_line(134),
           asdf like pdf_line occurs 0 with header line.
    data : pdf_table like tline occurs 0 with header line,
           pdf_fsize type  i.
    data : stuff(65000),
           len type i,
           pos type i,
           tab_lines like sy-tabix.
    data:  spoolid    type tsp01-rqident,
           spdel      type tsp01sys.
    data:  v_gjahrt like bsid-gjahr,
           fmondest(10),
           tmondest(10),
           kunnr1 like kna1-kunnr,
           gjah(4),
           fmon(10).
    *&      Form  hide_write
    form hide_write.
      new-page print on
        line-size 160
       line-count 58
        no-title
        no-heading
        destination 'LOCL'
        immediately ' '
        new list identification 'X'
        no dialog.
      set blank lines on.
    endform.                    " hide_write
    *&      Form  end_write
    form end_write using kunnr1.
      set blank lines off.
      new-page print off.
    ***Using Spoolid we are getting PDF formated file
      spoolid = spdel-rqident = sy-spono.
      spdel-sys = sy-sysid.
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
           exporting
                src_spoolid   = spoolid
                no_dialog     = 'X'
           importing
                pdf_bytecount = pdf_fsize
           tables
                pdf           = pdf_table
           exceptions
                others        = 0.
    ***Delleting Spool request
      call function 'RSPO_IDELETE_SPOOLREQ'
           exporting
                spoolreq = spdel
           exceptions
                others   = 2.
    ***Converting PDF table line size 134 into standard list size 255
      loop at pdf_table into pdf_line.
        if pos = 34170.
         perform attach.
        endif.
        stuff+pos(134) = pdf_line.
        add 134 to pos.
      endloop.
    if not ( stuff is initial ).
      perform attach.
    endif.
    clear pdf_line.
    clear pdf_table[].
    describe table i_att lines tab_lines.
    i_pack_list-transf_bin = 'X'.
    i_pack_list-head_start = '1'.
    i_pack_list-head_num = '1'.
    i_pack_list-body_start = '1'.
    i_pack_list-body_num = tab_lines.
    i_pack_list-doc_type = 'PDF'.
    i_pack_list-obj_name = 'LedgerMail'.
    concatenate fmon '-' gjah into i_pack_list-obj_descr.
    *i_pack_list-obj_descr = '2092-Oct03'.
    i_pack_list-obj_langu = 'E'.
    i_pack_list-doc_size = tab_lines * 255.
    append i_pack_list.
    ***Data for receivers list
    loop at it_inad where kunnr eq kunnr1.
    i_receivers-receiver = it_inad-smtp.
    i_receivers-rec_type = 'U'.
    i_receivers-rec_date = sy-datum.
    i_receivers-express = 'X'.
    i_receivers-com_type = 'INT'.
    i_receivers-notif_del = 'X'.
    append i_receivers.
    endloop.
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      exporting
        document_data                    = i_doc_data
      PUT_IN_OUTBOX                    = ' '
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
      tables
        packing_list                     = i_pack_list
        object_header                    = i_header
        contents_bin                     = i_att
        contents_txt                     = i_contents
        receivers                        = i_receivers
    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
    refresh i_att. clear i_att.
    refresh i_receivers. clear i_receivers.
    delete i_pack_list where doc_type = 'PDF'.
    *refresh i_header.
    *refresh i_contents.
    *clear i_doc_data.
    endform.                    " end_write
    *&      Form  doc_data
    form doc_data using fmondest v_gjahrt.
    gjah = v_gjahrt.
    fmon = fmondest.
    ***Data for Document Data
    i_doc_data-obj_name = 'LedgerMail'.
    concatenate 'Customer Ledger for : ' fmondest gjah
    into i_doc_data-obj_descr separated by space.
    i_doc_data-obj_langu = 'E'.
    i_doc_data-obj_prio = '1'.
    i_doc_data-no_change = 'X'.
    i_doc_data-doc_size = '5101'.
    ***Data for Packing list
    i_pack_list-head_start = '1'.
    i_pack_list-head_num = '1'.
    i_pack_list-body_start = '1'.
    i_pack_list-body_num = '20'.
    i_pack_list-doc_type = 'RAW'.
    i_pack_list-obj_langu = 'E'.
    append i_pack_list.
    ***Data for Header
    i_header-line = 'Header'. append i_header.
    ***Data for contents
    i_contents-line = 'Dear Customer,'. append i_contents.
    i_contents-line = ' '. append i_contents.
    concatenate 'Please find your enclosed Ledger for the month of : '
    fmondest gjah into i_contents-line separated by space.
    append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = 'This is a computer generated document and does not
    require a signature.'. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = 'Note : If you do not have Acrobat Reader please click
    on the below link.'. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = 'http://www.adobe.com/products/acrobat/readstep2.html'
    . append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    i_contents-line = ' '. append i_contents.
    endform.                    " doc_data
    *&      Form  attach
    form attach.
      clear pos.
      len = strlen( stuff ).
      while len > 0.
        subtract 255 from len.
        i_att = stuff+pos(255).
        append i_att.
        add 255 to pos.
      endwhile.
      clear pos.
      clear stuff.
    endform.                    " attach
    reward if useful.
    regards,
    Anji

  • Problem while sending mail to external mail ids

    Hi All,
    while trying to send mail to external mail ids through some custom program, i'm facing an error as "recipient not in address management".
    Can anyone giude me why this is occuring and actually what is this Address management?
    Thanks & Regards,
    Anil.

    Hi,
    Check this sample code..
    http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm
    * Add the recipients email address
      clear it_receivers.
      refresh it_receivers.
    <b>  it_receivers-receiver = p_email.
      it_receivers-rec_type = 'U'.
      it_receivers-com_type = 'INT'.</b>
      it_receivers-notif_del = 'X'.
      it_receivers-notif_ndel = 'X'.
      append it_receivers.
    what Fm you are using..?are you specifying like above for e-mail address..
    Regards
    vijay

  • Problem while sending mail inOIM 11g r2 after usercreation

    Hi,
    By default OIM sends mail to user mail id when the user created. i have tested this scenario using test mail server, it is working fine . when i am trying this scenario using exchange mail server, it is throwing errors. for Exchange just i have changed IT resource parameters.
    Authentication      true
    Server Name      ip address of the Exchange server
    User Login      [email protected]
    User Password *************
    is there anything missing. for SMTP server is ums nedded ?.
    <Oct 1, 2012 7:07:51 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Provider UMSEmailServiceProvider has encountered exception : javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused>
    <Oct 1, 2012 7:07:51 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider UMSEmailServiceProvider has encountered exception : Error occured while Sending Notification through Provider UMSEmailServiceProvider : javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused>
    <Oct 1, 2012 7:07:51 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider UMSEmailServiceProvider detailed exception : javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused>
    <Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.provider> <BEA-000000> <300>
    <Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Provider SOAEmailServiceProvider has encountered exception : java.lang.IllegalArgumentException: 300>
    <Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider SOAEmailServiceProvider has encountered exception : Error occured while Sending Notification through Provider SOAEmailServiceProvider : java.lang.IllegalArgumentException: 300>
    <Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider SOAEmailServiceProvider detailed exception : java.lang.IllegalArgumentException: 300>
    <Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Provider EmailServiceProvider has encountered exception : null>
    Thanks,

    Given below steps in oracle doc for UMS configuration. you can try the same
    Configuring UMS Provider for Sending Notifications (Optional)
    To configure Unified Messaging Service (UMS) provider for sending notifications:
    Edit the oim-config.xml file by using MBeans. To do so:
    Log in to Oracle Enterprise Manager.
    Navigate to Identity and Access, oim.
    Right-click oim(11.1.1.x.x), and select System MBean Browser.
    In the System MBean Browser, navigate to Application Defined MBeans, oracle.iam, Server: oim_server1, Application:oim, XMLConfig, Config, XMLConfig.NotificationConfig, EmailProvider.
    Click the EmailProvider attribute, and replace the value oracle.iam.notification.provider.EmailServiceProvider with oracle.iam.notification.provider.UMSEmailServiceProvider.
    Click Apply.
    Configure the Email Provider Instance - UMS IT resource with the UMS Web service details. To do so:
    Login to Oracle Identity Manager Administrative and User Console, and navigate to Advanced Administration.
    Click the Configuration tab, click Resource Management, and then click Manage IT Resource.
    Click Search. The list of IT resources is displayed.
    For the Email Provider Instance - UMS IT resource, click the Edit icon. The Edit IT Resource Details and Parameters page is displayed.
    Specify values in the following fields:
    Web service URL: The URL of the UMS web service to be invoked. For example, http://<SOA_host>:<SOA_Port>/ucs/messaging/webservice.
    Policies: The OWSM policy attached to the given web service. Leave this field as blank.
    Username: The username provided in the security header. If no policy is attached, then leave this field as blank.
    Password: The password provided in the security header. If no policy is attached, then leave this field as blank.
    Click Apply, and then close the popup window.
    Configure UMS Server for using a mail server other than the local LINUX mail server, which is picked by default. For example, to setup the mail server to use stbeehive email server:
    Stop the Linux Local sendmail email server running on the host, if this is a LINUX host, by running the following command:
    /usr/local/redhat/packages/aime/ias/run_as_root "/sbin/service sendmail stop"
    Configure Mail Server information in UMS Email Driver. To do so:
    i. Login to Oracle Enterprise Manager.
    ii. Expand User Messaging Service, and select usermessagingdriver-email (soa_server1).
    iii. From the Driver-Specific Configuration list, select Email Driver Properties.
    iv. Configure the following mandatory fields:
    OutgoingMailServer: The name of the SMTP server, for example, mailserver.mycompany.com.
    OutgoingMailServerPort: The port number of the SMTP server, for example, 465.
    OutgoingMailServerSecurity: The security setting used by the SMTP server. Possible values can be None, TLS, or SSL.
    OutgoingUsername: Any valid username similar to your mail client configuration, such as in the [email protected].
    OutgoingPassword: The password used for SMTP authentication. This consists of the following fields:
    Type of Password: Select Indirect Password, Create New User.
    Indirect Username/Key: Enter a unique string, for example, OIMEmailConfig. This masks the password and does not expose it in clear text in the configuration file.
    Password: Enter a valid password for this account.
    v. Click Apply.
    Right-click usermessagingdriver-email (soa_server1), and select Control, Shutdown.
    Allow at least 2 minutes to pass, after which you can restart the email driver. To so so, right-click usermessagingdriver-email (soa_server1), and select Control, Restart.

  • Problems while sending mail using java mail

    hi all,
    the following are the errors i get while sending a mail from my smtp local host-
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import javax.mail.Authenticator;
    import javax.mail.PasswordAuthentication;
    public class SendEmail
         public static void main(String[] args)
    System.out.println(args.length);
              if (args.length != 6)
                   System.out.println("usage: sendmessage <to> <from> <smtphost> <true|false> <subject> <text>");
                   System.exit(1);System.out.println("jj"+args.length);
         SendEmail m=new SendEmail();
         m.SendMessage(args[0],args[1], args[2], args[3], args[4], args[5]);
    public static String SendMessage(String emailto, String emailfrom, String smtphost, String emailmultipart, String msgSubject, String msgText)
    boolean debug = false; // change to get more information
    String msgText2 = "multipart message";
    boolean sendmultipart = Boolean.valueOf(emailmultipart).booleanValue();
    // set the host
    Properties props = new Properties();
    props.put("mail.smtp.host",smtphost);
         props.put("mail.smtp.starttls.enable","true");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.sendpartial", "true");
    Authenticator loAuthenticator = new SMTPAuthenticator();
    System.out.println("f");
    // create some properties and get the default Session
    Session session = Session.getDefaultInstance(props, loAuthenticator );
    session.setDebug(debug);
    try
    // create a message
    Message msg = new MimeMessage(session);
    // set the from
    InternetAddress from = new InternetAddress(emailfrom);
    msg.setFrom(from);
    InternetAddress[] address =
    new InternetAddress(emailto)
    //InternetAddress ad=new InternetAddress(session);
    msg.setRecipients(Message.RecipientType.TO, address);
    System.out.println("fc");
    msg.setSubject(msgSubject);
    System.out.println("fvf");
    if(!sendmultipart)
    // send a plain text message
    msg.setContent(msgText, "text/plain");
    System.out.println("fif");
    else
    System.out.println("felsd");
    // send a multipart message// create and fill the first message part
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setContent(msgText, "text/plain");
    // create and fill the second message part
    MimeBodyPart mbp2 = new MimeBodyPart();
    mbp2.setContent(msgText2, "text/plain");
    // create the Multipart and its parts to it
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    // add the Multipart to the message
    msg.setContent(mp);
    Transport transport = session.getTransport("smtp");
         transport.connect(smtphost,"[email protected]","xyz");
    msg.saveChanges();
    System.out.println("fconn");
              //transport.sendMessage(msg,msg.getAllRecipients());
    transport.sendMessage(msg,msg.getAllRecipients());
    transport.close();     
    //Transport.send(msg);
    catch(MessagingException mex)
    mex.printStackTrace();
    return "Email sent to " + emailto;
    class SMTPAuthenticator extends Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = "[email protected]";
    String password = "xyz";
    return new PasswordAuthentication(username, password);
    i dont understand what the problem is..inspite of having the right code..
    i guess some firewall problem..
    can somebody help me please..il be highly obliged..thanks..

    hi all,
    the following are the errors i get while sending a mail from my smtp local host-
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import javax.mail.Authenticator;
    import javax.mail.PasswordAuthentication;
    public class SendEmail
         public static void main(String[] args)
    System.out.println(args.length);
              if (args.length != 6)
                   System.out.println("usage: sendmessage <to> <from> <smtphost> <true|false> <subject> <text>");
                   System.exit(1);System.out.println("jj"+args.length);
         SendEmail m=new SendEmail();
         m.SendMessage(args[0],args[1], args[2], args[3], args[4], args[5]);
    public static String SendMessage(String emailto, String emailfrom, String smtphost, String emailmultipart, String msgSubject, String msgText)
    boolean debug = false; // change to get more information
    String msgText2 = "multipart message";
    boolean sendmultipart = Boolean.valueOf(emailmultipart).booleanValue();
    // set the host
    Properties props = new Properties();
    props.put("mail.smtp.host",smtphost);
         props.put("mail.smtp.starttls.enable","true");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.sendpartial", "true");
    Authenticator loAuthenticator = new SMTPAuthenticator();
    System.out.println("f");
    // create some properties and get the default Session
    Session session = Session.getDefaultInstance(props, loAuthenticator );
    session.setDebug(debug);
    try
    // create a message
    Message msg = new MimeMessage(session);
    // set the from
    InternetAddress from = new InternetAddress(emailfrom);
    msg.setFrom(from);
    InternetAddress[] address =
    new InternetAddress(emailto)
    //InternetAddress ad=new InternetAddress(session);
    msg.setRecipients(Message.RecipientType.TO, address);
    System.out.println("fc");
    msg.setSubject(msgSubject);
    System.out.println("fvf");
    if(!sendmultipart)
    // send a plain text message
    msg.setContent(msgText, "text/plain");
    System.out.println("fif");
    else
    System.out.println("felsd");
    // send a multipart message// create and fill the first message part
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setContent(msgText, "text/plain");
    // create and fill the second message part
    MimeBodyPart mbp2 = new MimeBodyPart();
    mbp2.setContent(msgText2, "text/plain");
    // create the Multipart and its parts to it
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    // add the Multipart to the message
    msg.setContent(mp);
    Transport transport = session.getTransport("smtp");
         transport.connect(smtphost,"[email protected]","xyz");
    msg.saveChanges();
    System.out.println("fconn");
              //transport.sendMessage(msg,msg.getAllRecipients());
    transport.sendMessage(msg,msg.getAllRecipients());
    transport.close();     
    //Transport.send(msg);
    catch(MessagingException mex)
    mex.printStackTrace();
    return "Email sent to " + emailto;
    class SMTPAuthenticator extends Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = "[email protected]";
    String password = "xyz";
    return new PasswordAuthentication(username, password);
    i dont understand what the problem is..inspite of having the right code..
    i guess some firewall problem..
    can somebody help me please..il be highly obliged..thanks..

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Problem while sending mail

    The following code is not working,the mail is not getting posted to the receiver.Can sum1 plz help...
    DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
    Creation of the document to be sent
    File Name
      doc_chng-obj_name = 'SENDFILE'.
    Mail Subject
      doc_chng-obj_descr = 'Send External Mail'.
    Mail Contents
      LOOP AT git_error INTO gwa_error.
       t1 = 'Success'.
       t2 = 'Operation successful'.
      ENDLOOP.
        objtxt = t1.
        APPEND objtxt.
        objtxt = t2.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    Creation of the entry for the compressed document
        CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 0.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        APPEND objpack.
    Completing the recipient list
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    Sending the document
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            put_in_outbox              = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        IF reclist-retrn_code = 0.
          WRITE:/ 'hello'.
    *WRITE 'The document was sent'.
        ELSE.
          WRITE 'The document could not be sent'.

    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = doc_chng
    put_in_outbox = 'X'
    <b>commit_work = 'X'</b>
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    receivers = reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    operation_no_authorization = 4
    OTHERS = 99.
    Just the parameter as indicated in bold and it should work.
    Dont forget to assign points for helpful answers

  • Problem while sending mail through posprocess event hadler  inOIM 11g r2

    Hi,
    i am sending mail through posprocess event hadler inOIM 11g r2 when user is created.But i am getting following error in resolver class.
    java.lang.NullPointerException
    at oracle.iam.identity.usermgmt.impl.UserDetailsProviderImpl.getUserDetails(UserDetailsProviderImpl.java:102)
    at oracle.iam.notification.impl.util.NotificationUtil.getUserPreferences(NotificationUtil.java:83)
    at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:523)
    at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:271)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at oracle.iam.notification.impl.util.NotificationUtil.getUserPreferences(NotificationUtil.java:83)
    at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:523)
    at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:271)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    Edited by: 853559 on Sep 25, 2012 6:27 AM

    If you are using Custom Notification XML, make sure to have StaticData element in it. StaticData defines the entitites that can be used in the notification template, and these entities attributes are used to define substitution tokens in the template.

  • Problems while sending mail using java mail..help...

    Hello all,
    I am new to Java Mail...
    Below is my first program...
    Can anybody tell what's wrong in it..??
    Thanks in advance....
    ------------------------------------------------------start--------------------
    package test;
    import java.util.Properties;
    import javax.mail.Address;
    import javax.mail.Authenticator;
    import javax.mail.MessagingException;
    import javax.mail.NoSuchProviderException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.Message.RecipientType;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class Send
         public Send()
         public void send()
              java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
              Properties props=new Properties();
              props.put("mail.transport.protocol", "smtp");
              props.put("mail.smtp.host","smtp.gmail.com");
              props.put("mail.smtp.port","25");
              props.put("mail.smtp.auth","true");
              Session session=Session.getDefaultInstance(props,new MyAuthenticator());
              session.setDebug(true);
              MimeMessage message=new MimeMessage(session);
              try
                   message.setContent("Hello ...","text/plain");
                   message.setSubject("Test mail...plz don't ignore..");
                   Address to=new InternetAddress("[email protected]");
                   Address from=new InternetAddress("[email protected]");
                   Address replyTo=new InternetAddress("[email protected]");
                   message.setFrom(from);
                   message.setReplyTo(new Address[]{replyTo});
                   message.setRecipient(RecipientType.TO,to);               
                   Transport.send(message);
              } catch (AddressException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (NoSuchProviderException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (MessagingException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         public static void main(String[] args)
              new Send().send();          
         class MyAuthenticator extends Authenticator
              MyAuthenticator()
                   super();
              protected PasswordAuthentication getPasswordAuthentication()
                   return new PasswordAuthentication("[email protected]", "*******");
    --------------------------------------------end--------------
    here is the output.....
    DEBUG: setDebug: JavaMail version 1.3.2
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 25, isSSL false
    220 mx.gmail.com ESMTP 16sm2443823wrl
    DEBUG SMTP: connected to host "smtp.gmail.com", port: 25
    EHLO jijo
    250-mx.gmail.com at your service
    250-SIZE 20971520
    250-8BITMIME
    250-STARTTLS
    250 ENHANCEDSTATUSCODES
    DEBUG SMTP: Found extension "SIZE", arg "20971520"
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    DEBUG SMTP: Found extension "STARTTLS", arg ""
    DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
    DEBUG SMTP: use8bit false
    MAIL FROM:<[email protected]>
    530 5.7.0 Must issue a STARTTLS command first
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first
         at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1275)
         at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:895)
         at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:524)
         at javax.mail.Transport.send0(Transport.java:151)
         at javax.mail.Transport.send(Transport.java:80)
         at test.Send.send(Send.java:50)
         at test.Send.main(Send.java:68)
    QUIT
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first
         at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1275)
         at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:895)
         at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:524)
         at javax.mail.Transport.send0(Transport.java:151)
         at javax.mail.Transport.send(Transport.java:80)
         at test.Send.send(Send.java:50)
         at test.Send.main(Send.java:68)
    Can any body help me..??
    Thanks and Regards
    Jijo vincent

    Hi All,
    I am new to javax.mail.
    I have attached my code and also error here...
    can anyone help to resolve the error?
    Code:
    public class MailExample {
         public static void main(String args[]) {
              try {
              String host = "localhost"; //args[0];
              String from = "[email protected]"; //args[1];
    //          String to = "[email protected]";//args[2];
              String to = "[email protected]";//args[2];
              java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
              // Get system properties
              Properties props = System.getProperties();
              // Setup mail server
              props.put("mail.smtp.host", host);
              props.put("mail.smtp.starttls.enable","true");
              //props.put("mail.smtp.auth","true");
              // Get session
              Session session = Session.getDefaultInstance(props, null);
              session.setDebug(true);
              // Define message
              MimeMessage message = new MimeMessage(session);
              // Set the from address
              message.setFrom(new InternetAddress(from));
              // Set the to address
              message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
              // Set the subject
              message.setSubject("Hello JavaMail");
              // Set the content
              message.setText("Welcome to JavaMail");
              // Send message
              Transport.send(message);
              catch(AddressException ae){
                   ae.printStackTrace();
              }catch (MessagingException e)
    //               TODO Auto-generated catch block
                   e.printStackTrace();
    Error:
    DEBUG: setDebug: JavaMail version 1.3.3ea
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth false
    DEBUG SMTP: trying to connect to host "localhost", port 25, isSSL false
    220 localhost
    DEBUG SMTP: connected to host "localhost", port: 25
    EHLO HDCHCTDAM33726
    250-localhost
    250 HELP
    DEBUG SMTP: Found extension "HELP", arg ""
    DEBUG SMTP: use8bit false
    MAIL FROM:<[email protected]>
    250 [email protected] Address Okay
    RCPT TO:<[email protected]>
    250 [email protected] Address Okay
    DEBUG SMTP: Verified Addresses
    DEBUG SMTP: [email protected]
    DATA
    354 Start mail input; end with <CRLF>.<CRLF>
    Message-ID: <10736847.01125315340863.JavaMail.sangeetham@HDCHCTDAM33726>
    From: [email protected]
    To: [email protected]
    Subject: Hello JavaMail
    MIME-Version: 1.0
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    Welcome to JavaMail
    com.sun.mail.smtp.SMTPSendFailedException: 550 Invalid recipient: [email protected]
         at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1333)
         at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1160)
         at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:538)
         at javax.mail.Transport.send0(Transport.java:151)
         at javax.mail.Transport.send(Transport.java:80)
         at org.worldbank.webmfr.util.MailExample.main(MailExample.java:55)550 Invalid recipient: [email protected]
    com.sun.mail.smtp.SMTPSendFailedException: 550 Invalid recipient: [email protected]
         at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1333)
         at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1160)
         at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:538)
         at javax.mail.Transport.send0(Transport.java:151)
         at javax.mail.Transport.send(Transport.java:80)
         at org.worldbank.webmfr.util.MailExample.main(MailExample.java:55)
    QUIT

  • 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 mail tru campaign

    I have serious problem while sending mail thru a campaign in WebLogic 8.1.4 Portal. While running the application and visiting a portlet which contains the PlaceHolder which in turn is supposed to execute the campaign, the console
    shows an unending exception stack trace. The Exception is : "Exception:SQL Exception creating bucket entry ... transaction rolledback".
    Please help
    Thanks in advance
    Muhammed Shakir

    Turn on session debugging and examine the protocol trace. If you still can't figure it out,
    post the debug output here.
    Most likely you have a firewall or antivirus product that's closing the connection unexpectedly.
    Possibly your server is disconnecting for some reason. The protocol trace might provide clues.

  • I am getting this message: An error occurred while sending mail. The mail server responded: 5.3.4 Requested action not taken; To send your message, please sign into your account online first and solve a puzzle. (Sorry for the inconvenience--these puzzles

    I am trying to send a message with an attachment, I get this message: An error occurred while sending mail. The mail server responded: 5.3.4 Requested action not taken; To send your message, please sign into your account online first and solve a puzzle. (Sorry for the inconvenience--these puzzles help us stop spammers.). Please check the message and try again.
    == Today

    Me too (with Thunderbird). EXCEPT it reads
    Requested action not taken; This account is currently blocked from sending messages. If you don't think you've violated the Windows Live Terms of Use, please contact customer support...
    Occasionally the mail "sends", but it is unpredictable. Tech Support at Qwest (for q.com under Windows Live) does not find a problem at their end.
    More suspiciously, the same account accessed from my Mac does not seem to exhibit this problem. Have reloaded T'bird. Recurred again.

Maybe you are looking for