Sending Email problem in webdynpro Application

Hi all,
      I have the written following coding to send a mail.It was working fine till we upgrade our mailing server to Exchange server2007.
  Properties properties = new Properties();
   String SMTPIPAddress = "mail.exchange.com"
   String SMTPAddress = "mail.smtp.host";
    String mailId = "[email protected]";
    Session session;
    Provider p;     
    properties = System.getProperties();               
    properties.put(SMTPAddress, SMTPIPAddress);
    session = Session.getDefaultInstance(properties, null);
    Message message = new MimeMessage(session);               
    message.setFrom(new InternetAddress("[email protected]"));     
    message.addRecipient(Message.RecipientType.TO,
                                                   new InternetAddress(mailId));
    message.setSubject("Conference");           
    message.setText(strMailBody.toString());          
    Transport.send(message);
Now I am geeting the following error.
      Exception : Sending failed;  nested exception is:  
       javax.mail.MessagingException: 530 5.7.1 Client was not authenticated 
When I approahed the Admin people for the above error, since some relay must opened to receive the mail, they said it cannot be done in the exchange server.
Is there any other way to send mail (different codings)
Thanks in advance
Ponnusamy P

Hi Ponnusamy,
First of all, use
Session.getInstance()
instead of
Session.getDefaultInstance()
<i>Since the default session is potentially available to all code executing in the same Java virtual machine, and the session can contain security sensitive information such as user names and passwords, access to the default session is restricted.</i>
Second, I forgot, <i>To use SMTP authentication you'll need to set the mail.smtp.auth property [...]</i>. See also <a href="http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html">com.sun.mail.smtp (JavaMail API documentation)</a>.
Everything together becomes
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.host", "mail.exchange.com");
Session session = Session.getInstance(props, new MyAuthenticator());
BTW, does the <i>AuthenticationFailedException</i> contain any additional information that indicates why authentication failed?
Just note that JavaMail supports <i>SMTP Authentication (RFC 2554) using the LOGIN, PLAIN, and DIGEST-MD5 mechanisms [...] When using DIGEST-MD5 authentication, you'll also need to supply an appropriate realm; your mail server administrator can supply this information. You can set this using the mail.smtp.sasl.realm property, [...]</i>.
So only LOGIN, PLAIN and DIGEST-MD5 are supported. It's very well possible your Exchange server is configured to support only NTLM and I can imagine your Exchange admin won't allow LOGIN authentication due to security reasons.
And a last remark. <i>If your username is foo, your mailbox name is Foo.Bar and your server is FUBAR, your username for connecting to your mailbox is not foo. Instead, it would be FUBAR\foo\Foo.Bar</i>.
Kind regards,
Sigiswald

Similar Messages

  • Sending emails from the JSP application

    hi,
    I am trying to send emails from my jsp application using JavaMail API's.
    I am using my own mailserver.
    Iam able to send emails from my applications to the ids of my own mailserver but not the yahoo,gmail and rediff ids.
    Is it because of blocking of any firewall or somthing else to do within my application?
    Can anyone help me in this?
    Thanks a lot.

    Please read the JavaMail FAQ.
    It's probably due to the configuration of your mail server,
    which is refusing to relay your messages.

  • Sending  a  Email  from the  webdynpro application

    Hi Guys,
                 I   am having  one requirement in my application .ie. Email  to the  specified  Id .
    As  per   my reqirement  i am having  4  fields  in my  UI page.
    Task Id              : T001 
    Assigned to       : ratnakar   
    Mail id               : [email protected]
    Task Description : Test Area
    Submit : Save(Button)
    when i  click  the  Save button the    Email has to reach the  specified id with the  task description.
    could  any  body  please help  how to proceed .........
    Thanks  and Regards
    Ratnakar reddy

    Hi  Guys,
         Some body  sugested me  to use the  javaMail  api .. i donot  exactly how to use  it in the  webdynpro application. some where i got the  below  code ...
    InitialContext ctx = new InitialContext();
    Properties props = new Properties();
    props.put("mail.smtp.host","Message server");
    Session sess = Session.getInstance(props);
    Message message = new MimeMessage(sess);
         message.setFrom(new InternetAddress(wdContext.currentContextElement().getFrom()));
         String recepient = wdContext.currentContextElement().getTo();
         message.setRecipient(Message.RecipientType.TO, new InternetAddress(recepient));
         String subject = wdContext.currentContextElement().getSubject();
         message.setSubject(subject);
         String content = wdContext.currentContextElement().getMessage();
         message.setContent(content,"text/plain");
    //       Send the message
         Transport.send(message);
    if i use the above same code  i am not able resolve  some errors with  the  session and   internetAddress. becuse  there are  no   supporting Imports  to  handle them even if used the  Organise imports.
            i am  very new  to  this  mailing concept  can any body  give me a    step by step process  ...to  send the mail to the  specified in the  user interface.
    Thanks and regards
    Ratnakar

  • Old but new Q: Cannot send email from Mac Mail application but computer tells me I'm online

    I know this is an "old" issue for many, but I cannot find the solution to my problem.
    A couple of months ago I moved to a new flat--suddenly I could not send emails anymore from my Mac Mail app, although I could receive them. I called Comcast, my Internet provider, who said it was my email server's problem. My email server is icloud, so I talked to a Mac tech guy who did remote desktop troubleshooting and said everything was set up correctly, etc., so I will have to talk to Comcast again. I called Comcast again and they told me again, it is not their issue.
    So this is what happens: When I try to send an email, I get the spinning circle in the mailbox bar, and then it tells me after five minutes of spinning that icloud is offline. However, when I do a further check of the diagnostics, the light is green and says that yes, in fact I am connected/online. Note: I can send and receive fine on webmail, but I do not want to keep using webmail at home. It is very inconvenient.
    I called Mac support again, and they told me I should find my solution online; otherwise, I can pay $20 to have someone remotely troubleshoot for me. Of course, I could not find the answer online. I am quite frustrated and annoyed at this point. Is it a port issue? Is it an OS issue? Mind you, I only have this problem at home, nowhere else. I take my laptop to a café, to a friend's place--I can send emails just fine. This leads me to believe that it's a Comcast issue, although they deny it.
    Any thoughts would be deeply, deeply appreciated! Thank you!!

    How about some free much-needed advice on how I can
    start receiving emails again!
    This indicates you were able to receive email with
    your Verizon account previously with the Mail.app?
    If so, try running Keychain First Aid on your login
    Keychain.
    http://docs.info.apple.com/article.html?artnum=151548
    Open Keychain Access, located in
    Applications/Utilities.
    Choose Window > Keychain First Aid.
    Select your login Keychain, enter your password,
    select Repair and then Start.
    This is Trevor from the first post and I figured it out:
    Go into mail - preferences - and delete the email account in question - the window will tell you that you'll lose all your saved mail, etc - you can save it if you like.
    Then click on yes and you create a new mail account using your same incoming/outgoing settings. And, like magic, it works!
    Try it - and if you want to save any mail before deleting your affected account, do it.
    All the best!
    Trevor "

  • Error when sending email from a web application that runs on GlassFish

    Hello all, I hope some can give me some hints on how to fix this problem.
    I have a web application built in Java that runs on GlassFish v3.
    The application uses a mail plugin that makes use of mail.jar
    Whenever I try to use the plugin to send an email out I get an error.
    The application is programmed to send emails from a gmail account, and I believe there is a problem with the SSL version that Googlemail is expecting.
    By the way, everything works fine if I run the web app on other servers like Jetty or Apache.
    The stacktrace I get from the log when the error occurs is as follows:
    INFO: 2009-05-08 19:48:57,500 [httpWorkerThread-8080-0] ERROR errors.GrailsExceptionResolver - org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)
    org.codehaus.groovy.runtime.InvokerInvocationException: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:337)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:883)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:732)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:554)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:485)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:377)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382)
    at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
    at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:460)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
    at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
    at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
    at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
    at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
    at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
    at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
    Any help would be really appreciated... honestly I'm pretty stuck.
    Alex

    Hi Alex,
    Since I had a Gmail test servlet kicking around, I ran it on the latest V3 nightly build.
    On the first run, I encountered the following nested exceptions:
    javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465
    --> java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)
        --> java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)
            --> java.security.UnrecoverableKeyException: Password must not be nullThe UnrecoverableKeyException is a manifestation of [https://glassfish.dev.java.net/issues/show_bug.cgi?id=6938|https://glassfish.dev.java.net/issues/show_bug.cgi?id=6938]
    I worked around this by adding the following JVM config options to domain.xml
    <jvm-options>-Djavax.net.ssl.keyStorePassword=changeit</jvm-options>
    <jvm-options>-Djavax.net.ssl.trustStorePassword=changeit</jvm-options> (Note: the default master password is "changeit")
    These lines are placed in /domain/configs/config/java-config of domain.xml for the particular server config you're using. There's only one server config in the default domain.xml shipped with V3. Then restart the server.
    I retested the code on both port 465 and 587, with and without the above config changes. Without the change, they both fail the same way, and with the change, they both work. Let me know if this helps.
    -Peter

  • Sending EMail "Text-File" from Application Server!

    Hi Experts,
    how can I sending a Text-File from Application Server via Email?
    Is there existing a Function Modul?
    With Kind regards
    Ersin
    Moderator message: sending emails = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 25, 2010 4:23 PM

    STF (Search the forum)!  This type of question has been asked...and answered....many times.

  • Refresh problem of Webdynpro application which is wrapped in a BSP IFrame

    I have a BSP Iframe inside which I am calling a webdynpro application ('zwdc_re_replenishment'). The requirement is that this WD application should be reloaded whenever a timeout occurs. Currently, when there is a timeout, an error is shown.
    In order to achieve this, for this WD Application , I have a SICF node to which I have attached a customized Errorpage via the option 'Redirect URL'.
    Whenever the WD application undergoes a timeout error, my custom error page is called which is named as errorpage.htm. On this page in the 'OnInitialization event', I try to call the WD application URL again (via the following code) which should reload the application. But instead I get a blank page.
    CALL METHOD cl_wd_utilities=>construct_wd_url
      EXPORTING
        application_name = 'zwdc_re_replenishment'
      IMPORTING
        out_absolute_url = lv_def_url.
    response->redirect( url         = lv_def_url
                        permanently = 1 ).
    Just as a note I have already tried out the following methods as well but nothing works
    *navigation->exit( lv_def_url ).
    *navigation->call_application( lv_def_url ).
    Is this because my WD application is inside a BSP Iframe and therefore reloading it manually does not work ?
    Please help!
    Thanks.
    Sukanya

    Hi Thomas,
    First of all, thanks a lot for replying !!
    Sorry for the confusion. Although seems like you have answered my question already.
    Actually the requirement for embedding WDA inside a BSP Iframe came up since there are some WD report applications  that are accessed by very controlled environments in which the users were not able to close the WDA session directly (without the IFrame)  and were getting some errors. Hence the WDAs had to be wrapped inside BSP IFrame which solved the above problem.
    I am working with only one BSP app which has the Iframe and one WD app which is called within the BSP app.
    Now, the other requirement that came up was that whenever the WDA session inside the BSP IFrame expires, there should be no error page and instead the WD app should be reloaded.
    So  I was trying to reload the WD App in the following way.
    1. For the SICF node of WDA, I attached an errorpage.htm for all the tabs under the tab 'Error Pages'. I have defined this errorpage.htm inside the same BSP App which has got another default.htm page. So the BSP App has 2 views : default.htm which has the IFrame and Errorpage.htm.
    2. So now when the WDA expires, the events of errorpage.htm are called like OnInitialization, In this event I was calling the methods navigation->exit( 'URL of the same WDA' ).
    I did this because I wanted to reload the WDA whenever it expires. I tried to specify the WDA Url in the SICF node of the same WDA in 'Redirect URL' under the Error Page tabs but it didnot work.
    Now I realize this is not gonna work. I didnot want to modify the WDA and so I didnot specify any exit plugs in the WDA which would have taken care of reloading the WDA. But that seems to be the only way out.
    Actually speaking there are multiple WDAs which will open inside the same BSP IFrame via their own Application URLs. I have coded the BSP IFrame to read the URL Parameters and open up the corresponding WDA.  So now I have to define an exit plug in all of these WDAs.
    Do you suggest that this will solve the problem of WDA refresh ? Just to confirm.
    Thanks again.

  • Anyone has a remedy for mail/leopard sending emails problem ?

    I just spend hours on my MBP trying to set up MAIL and on various forums trying to find a cure for what seems to be a common problem on Leopard, not being able to send emails. I like many others are getting the "can not send message using the smtp server verify that you have addressed this message correctly. Check your SMTP server settings in Mail Preferences and verify any advanced settings with your system administrator"
    Ok I verified till I was blue, all settings are ok, info provided by ISP and checked, I tried various other combinations and I keep getting the same message. I can receive emails no probs and I can also send emails to myself . I looked on Apple site and it just tells me to check everything, yes it's a known problem but no cure in sight.They simply can't be serious and expect people to be without such an important function? So this means that I cannot send emails until someone gets off their a**e at Apple and fixes this problem ? Can any of you kind folks help, what else should I try ? I have been on Apple now for half a year but encountered same problems and grief as I had with windows for years.

    found problem
    im using aol still
    aol just implimented a image verification (stupid) i downloaded the new aol desktop for mac and tried sending a test email.. it asked me to verfiy myself and now it works... dumb
    so if you have same problem, download aol desktop for mac and send a test email, it will tell you do a image verfication.. do it and then it will say you can now send email...
    how stupid... like the login/password wasn't enough...
    and now i just can't even imagine why they are loosing money and almost gone (aol)

  • Send email problem

    Hi,
    I have great problem with my mail. I can get emails, but if I try to answer or send new email after few minutes the system open window and say: Cannot send message using the server. Select a different outgoing mail server from the list below. (I have 4 different servers including the default one: smtp.me.com:vybiral) I see that 3 servers are marked offline and smtp.me.com:vybiral is not marked. I can not send email from any of this servers. But from my iphone email it works good.
    The problems started sinc my mobile me account expired. After few days I did renew the account and the problems with sending emails started. If I log on my mobileMe throu web I can send emails as well. The problem is only in my mail aplication in notebook.
    Can you help me to solve the problem? Thank you very much.

    I'm having the same problem. It started after I updated to the latest security update today.

  • Is iOS 5 going to fix the sending email problem I have since I updated to 4.3.5?

    Ever since I updated my 3gs to iOS 4.3.5 im having a big problem sending emails. Does anyone know if ios 5 will fix that?

    Try it and see.

  • Sending email - problems with text in email body

    Hello all,
    for sending emails I use the FM from Thomas Jung (<a href="http:///people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface:///people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface).
    Everything works fine, except that the text I attach in documents-content_text doesn't appear as a normal text in the email body but within an .EXT-attachment. Should this be a TXT attachment?
    E.g. when I send the text 'Hello World' the email arrives with an attachment 'Hello World.EXT'.
    Did anyone have the same problem? What's wrong?
    Thanks for your help.
    Regards
    Joschi

    Try this it works fine for me,
    METHOD email_result_as_pdf.
        DATA: lo_document_bcs    TYPE REF TO cl_document_bcs VALUE IS INITIAL,
              lo_send_request    TYPE REF TO cl_bcs VALUE IS INITIAL,
              lo_sender          TYPE REF TO if_sender_bcs VALUE IS INITIAL,
              lo_recipient       TYPE REF TO if_recipient_bcs VALUE IS INITIAL,
              lo_cx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL,
              lo_cx_send_req_bcs TYPE REF TO cx_send_req_bcs VALUE IS INITIAL,
              lo_cx_address_bcs  TYPE REF TO cx_address_bcs VALUE IS INITIAL.
        DATA: li_message_body     TYPE bcsy_text VALUE IS INITIAL,
              li_att_content_text TYPE soli_tab,
              lw_att_content_text TYPE soli.
        DATA: lv_result         TYPE string,
              lv_send           TYPE adr6-smtp_addr
                                     VALUE '[email protected]',
              lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
    * Create Object
        lo_send_request = cl_bcs=>create_persistent( ).
    * Add Contents to Mail Body
        APPEND 'Dear Sir,<BR>' TO li_message_body.
        APPEND ' ' TO li_message_body.
        APPEND 'Please find the Report contents enclosed.<BR>' TO li_message_body.
        APPEND ' ' TO li_message_body.
        APPEND 'Thank You,<BR>' TO li_message_body.
    * Create a Document
        TRY.
            CALL METHOD cl_document_bcs=>create_document
              EXPORTING
                i_type    = 'HTM'
                i_text    = li_message_body
                i_subject = 'New ALV Sample Report'
              RECEIVING
                result    = lo_document_bcs.
          CATCH cx_document_bcs INTO lo_cx_document_bcs.
            lo_cx_document_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Populate the data to the Document Table
        LOOP AT i_sbook INTO w_sbook.
          CONCATENATE
            w_sbook-carrid
            w_sbook-connid
            w_sbook-fldate
            w_sbook-bookid
            w_sbook-customid
            w_sbook-custtype
            w_sbook-smoker
            w_sbook-wunit
            w_sbook-invoice
            w_sbook-class
            w_sbook-forcurkey
            w_sbook-loccurkey
            w_sbook-order_date
            w_sbook-counter
            w_sbook-agencynum
            w_sbook-cancelled
            w_sbook-reserved
            w_sbook-passname
            w_sbook-passform
            w_sbook-passbirth
            INTO lw_att_content_text-line
            SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
          CONCATENATE cl_abap_char_utilities=>cr_lf lw_att_content_text-line
                      INTO lw_att_content_text-line.
          APPEND lw_att_content_text TO li_att_content_text.
        ENDLOOP.
    ** Add the attachment to the document
        TRY.
            CALL METHOD lo_document_bcs->add_attachment
              EXPORTING
                i_attachment_type    = 'RAW'
                i_attachment_subject = 'New ALV Sample Report'
                i_att_content_text   = li_att_content_text.
          CATCH cx_document_bcs INTO lo_cx_document_bcs.
            lo_cx_document_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Set the document to the Send Request
        TRY.
            CALL METHOD lo_send_request->set_document
              EXPORTING
                i_document = lo_document_bcs.
          CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
            lo_cx_send_req_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Create Sender
        TRY.
            CALL METHOD cl_cam_address_bcs=>create_internet_address
              EXPORTING
                i_address_string = lv_send
              RECEIVING
                result           = lo_sender.
          CATCH cx_address_bcs INTO lo_cx_address_bcs.
            lo_cx_address_bcs->if_message~get_text(
                          RECEIVING
                              result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Add Sender to Mail
        TRY.
            CALL METHOD lo_send_request->set_sender
              EXPORTING
                i_sender = lo_sender.
          CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
            lo_cx_send_req_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Create Receipient
        lv_send = '[email protected]'.
        TRY.
            CALL METHOD cl_cam_address_bcs=>create_internet_address
              EXPORTING
                i_address_string = lv_send
              RECEIVING
                result           = lo_recipient.
          CATCH cx_address_bcs INTO lo_cx_address_bcs.
            lo_cx_address_bcs->if_message~get_text(
                          RECEIVING
                              result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Add Receipient to Mail
        TRY.
            CALL METHOD lo_send_request->add_recipient
              EXPORTING
                i_recipient = lo_recipient
                i_express   = 'X'.
          CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
            lo_cx_send_req_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Set Send Immediately
        TRY.
            CALL METHOD lo_send_request->set_send_immediately
              EXPORTING
                i_send_immediately = 'X'.
          CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
            lo_cx_send_req_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Send Mail
        TRY.
            CALL METHOD lo_send_request->send
              EXPORTING
                i_with_error_screen = 'X'
              RECEIVING
                result              = lv_sent_to_all.
            COMMIT WORK.
          CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
            lo_cx_send_req_bcs->if_message~get_text(
                                  RECEIVING
                                      result = lv_result ).
            MESSAGE lv_result TYPE 'E'.
        ENDTRY.
    * Inform User
        IF lv_sent_to_all EQ 'X'.
          COMMIT WORK AND WAIT.
          MESSAGE 'Mail Sent Successfully' TYPE 'I'.
        ELSE.
          MESSAGE 'Error Sending Mail to External Id' TYPE 'E'.
        ENDIF.
      ENDMETHOD.                    "email_result_as_pdf
    Regards
    Kathirvel

  • Sending email problems from iphone since upgrade to 4.3.5 and now with 5

    I'm having problems sending email more often than not. Does anyone know why tis is happening and if there is a fix for this? I am using yahoo.

    There is no way to officially do what you're trying to do, and the terms of use here prohibit us from giving you instructions. Sorry.

  • Sending Emails problem

    i have a problem sending emails... I'm looking in most of the other questions that are similar and I am not getting an answer. I use mail all the time. it's a university mail address and whenever i try to send it gives me this message smtp.dal.ca failed.
    I don't understand... i can mail perfectly from my ibook,i've tried fooling around with the settings... can someone help!?!?

    Settings are different than your PC. Who is your mail provider?  ie Charter, Comcast, TWC, yahoo...etc

  • Sending emails problems

    Hi I am having problems in sending emails from my IPhone 4 I sync with my Outlook 2010 client no problem and can receive emails but cant send them any ideas thanks Peter

    I'm having the same problem
    I receive a message saying that I have no password, but I put the password over and over but does not work

  • Incident Management sending EMAIL problem

    Dear Solman Gurus,
    We are using Sap Solman 7.1 incident management,
    As screen shot maintained below. When i try to open a message there 3 options to use incident system. When i choose "Incident(VAR)(SMIV)" and "Support Message(SLFN)" not send automatic EMAIL.
    But when i choose "Incident(VAR) V (ZMIV)" it sends EMAIL related to ticket owners. How can i activate sending EMAIL features for others ?
    I need your help
    Regards

    Hello Kemal,
    SAP suggest to use new transaction types sucha as SMIN or SMIV
    1567003 - FAQ: ST710 Incident Management Frequently Asked Questions
    SAP recommends that you transition from your old transaction types (based on transaction type SLFN) to the new ones.
    Please check if configurationg is maintained according to blog
    Sending E-Mail from Support Message
    BR,
    K.

Maybe you are looking for