Plz help : "AUTOMATIC" Mail sending

Hey Friends
Please see the word "automatic", as soon as user enters a good receipt in MB01 or MIGO, an automatic mail should be send to [email protected] stating:
Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
Please tell me how to do this as automatic.
i have found that data is stored in the MSEG table, but how to use it so that and automatic mail is send.
Thanks

Hi,
To send an email please use this sample code:
* Declarations.
PARAMETERS: p_email(50) LOWER CASE.
DATA: document_data LIKE sodocchgi1.
DATA: t_content LIKE STANDARD TABLE OF solisti1.
DATA: s_content LIKE solisti1.
DATA: t_receivers LIKE STANDARD TABLE OF somlreci1.
DATA: s_receivers LIKE somlreci1.
START-OF-SELECTION.
* Receivers.
s_receivers-receiver = p_email.
s_receivers-rec_type = 'U'.
s_receivers-express = 'X'.
APPEND s_receivers TO t_receivers.
* Subject
document_data-obj_descr = 'New mail from Sap'.
* Body
s_content = 'Hi,'.
APPEND s_content TO t_content.
CLEAR: s_content.
APPEND s_content TO t_content.
s_content = 'Test email from sap, please don''t reply to this email'.
APPEND s_content TO t_content.
CLEAR: s_content.
APPEND s_content TO t_content.
s_content = 'Thanks,'.
APPEND s_content TO t_content.
s_content = 'Naren.'.
APPEND s_content TO t_content.
* Send the email.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
TABLES
object_content = t_content
receivers = t_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.
IF sy-subrc <> 0.
MESSAGE e208(00) WITH 'Error in sending email :-(('.
ELSE.
MESSAGE s208(00) WITH 'Email sent :-))'.
ENDIF.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
In order to do it automaticly either:
- create program which will read a table and look for new entries and schedule it SM36
- use workflow (configure event handling)
Regards,
Wojciech

Similar Messages

  • IDOC - Automatic Mail Sending

    Hi All,
    Basically I need to remove the automatic mail sending feature in the IDOC, please give me the solution, whether  it is standard functionality, or is there any user exit to avoid.
    If it is a Standard functionality then mention the Std. Program name or
    If it is from userexit then plz mention the Exit name.
    Thanks In Advance.

    think u need to check tcode swu3 for automatic workflow customizing and check in we40 (error AND STATUS PROCESSING) whether the processing code is assigned to the workflow task.
    if it is assigned,the workflow will be automatically triggered and the mail will be sent to the user by itself.
    ALE error handling uses workflow. A standard task is provided for each message type. Task TS20000051 is used for all BAPIs.
    Workflow functions as follows:
    A task (work item) is generated for the error handling and stored as a message in the inboxes of the employees responsible.
    If one of these employees processes the work item, the standard task method for error handling is started. The user can, for example, restart IDoc processing.
    If the IDoc is processed successfully, the work item is deleted from the inboxes of all the employees involved.
    For this procedure to function, the employees responsible for a particular message type and partner (sender or receiver) must be defined as follows:
    1. A hierarchy of organizational units (for example, "sales office") and positions (for example, "customer officer for customer X") is created and employees are assigned to it.
    2. The standard tasks for error handling (for example, an error related to an inbound sales order) are assigned to the relevant organizational units or positions (for example, "sales office").
    3. The organizational unit, position or employee responsible for dealing with the error are specified for each partner and message type in the partner profiles.
    If an error occurs, the system determines:
    1. The employees responsible using the staffing schedule of the organizational unit or position linked to the standard task.
    2. The employees defined in the partner profiles (using position, user ID, or organizational unit).
    3. The employees appearing in both groups represent those who will receive a work item in their inboxes.
    Please give me reward point If it is useful
    Thanks
    Murali Poli

  • Plz help droid  not sending mms!

    just says under it sending and never sending it. plzs help me fix this! thanks

    Well, they are pretty much your only option to resolve this. Are you using a supported carrier? Are they on this list? http://support.apple.com/kb/ht1937

  • Applescript Help - Automatic Email Send to Group

    Hey guys,
    Me again. Ok, so I am starting to get the hang of this, learning more and more on applescripting. You guys have been a great help.
    Now, I have a little applscript that I want to send an email automatically to a Group in my address book. However for the life of me, I can't figure out how to do that! Or is this just not possible? Please advise!
    Here it is:
    set theToRecipient to "My group" -- this would be the group name of email addresses that is in my address book
    set theSubject to "The subject of the message"
    set theContent to "the content of my message."
    tell application "Mail"
      activate
              set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
              tell newMessage
      make new to recipient at end with properties {address:theToRecipient}
      send newMessage
              end tell
    end tell
    Appreciate all your help.

    Try this --
    set theToRecipient to {}
    tell application "Address Book"
              if group "MyGroup" exists then
                             set theToRecipient to "MyGroup"
              end if
    end tell
    set theSubject to "The subject of the message"
    set theContent to "the content of my message."
    tell application "Mail"
      activate
              set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
              tell newMessage
      make new to recipient at end with properties {address:theToRecipient}
      --send newMessage
              end tell
    end tell

  • Need help with mail sending mails..

    Can anybody help me with a code that works perfectly for sending mails.. since i used many codes which are not working, so please help me with the code to send mails please or else with an example.

    Hi kirupa_sankar,
    To send mails to others you have to use javax.mail.jar file and sample code is
    import javax.mail.*;
    import javax.mail.internet.*; // important
    import javax.mail.event.*; // important
    import java.net.*;
    import java.util.*;
    public class Mail {
    Properties props;
    Session session1;
    Message message;
    boolean flag=false;
    public boolean sendMail()
    props=new Properties();
    props.put("mail.smtp.host","mail.website.com"); // 'localhost' for testing
    session1 = Session.getDefaultInstance(props,null);
    String from= "[email protected]" ;
    String subject = "testing mail(subjective matter)";
    message =new MimeMessage(session1);
    message.setFrom(new InternetAddress(from));
    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("toaddress",false));
    message.setSubject(subject);
    message.setContent("content of the message");
    Transport.send(message);
    return true;
    try this one you will get success....

  • Automatic mail sending at good receipt

    Hello friends
    When a goods receipt against a PO (movement type 101) is done into any plant , an e-mail should be sent to ‘[email protected] ’ stating:
    Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
    Plz suggest how to do this.
    what are the tables that can be used
    wat are the fms that can be used etc
    where this can be configuered,, or done thru ABAP

    Hi,
    1.create an enhancement project using enhancement number:MBCF0005..
    in CMOD and in the below fuction module exit you can add you logic to send the mail.
    <b>EXIT_SAPM07DR_001.</b> in INCLUDE ZXMBCU05 .
    2.you can get all the required data in the MSEG table.
    3. you can use the following fuction module to send the email.
    'SO_NEW_DOCUMENT_ATT_SEND_API1'
    below is the sample code..
    REPORT ZPAVAN_EXAMPLE.
    DATA: OBJPACK     LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
          OBJHEAD     LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          OBJBINLIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          OBJTXTLIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          RECLISTLIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
          DOC_CHNGLIKE SODOCCHGI1,
          TAB_LINES LIKE SY-TABIX.
    PARAMETER P_EADDR LIKE RECLIST-RECEIVER.    "EXTERNAL E-MAIL ADDRESS
    DOC_CHNG-OBJ_NAME = 'SENDFILE'.
    DOC_CHNG-OBJ_DESCR = 'SEND EXTERNAL MAIL'.
    OBJTXT = 'LINE 1 OF MESSAGE'.
    APPEND OBJTXT.
    OBJTXT = 'LINE 2 OF MESSAGE'.
    APPEND OBJTXT.
    DESCRIBE TABLE OBJTXT LINES TAB_LINES.
    READ TABLE OBJTXT INDEX TAB_LINES.
    DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    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.
    RECLIST-RECEIVER = P_EADDR.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    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 = 3
              OTHERS                     = 4.
    IF SY-SUBRC EQ 0.
      WRITE:/ 'E-MAIL MESSAGE SENT TO', P_EADDR.
    ELSE.
      WRITE:/ 'COULD NOT SEND E-MAIL TO', P_EADDR.
    ENDIF.
    thanks and Regards,
    Pavankumar

  • Automatic Mail Sending in Java/JSP/Servlets

    Hi,
    How to send mails with a specified format automatically after a stipulated no of days when the user does not access a file/page.
    TIA

    1. In your web application, have a database that keeps track of when a user accesses a page.
    2. Once a day, run a program that scans that database looking for cases when a user has not accessed a page for N days, or whatever your criterion is. Use JavaMail to send an e-mail message to each of those users.
    If you have specific questions about any of these things, don't hesitate to ask them in the appropriate forum.

  • ABAP Query Automatic mail send

    Dear ABAP Gurus,
    Is it possible for a query to build/fix a printer to a query?  When you run the query , it should send the layout to the person who run it in PDF format. How can it be done without any abap code?
    many thanks
    John Black

    Hi Prashantroy
    You can change the text of the notification e-mails as described in "Changing the Texts of Notification E-Mails".
    Refer to [Notification by E-Mail  |http://help.sap.com/saphelp_nw04/helpdata/en/89/c5fd430b63c74bbdfaa5f2ec9bb20b/content.htm]
    Hope it will helps
    Best Regards
    Arun Jaiswal

  • Automatic mail sending freezes outlook 2013

    I have a brand new laptop with fresh installation of Office Home and Business 2013, and there is a problem i can't wrap my head around it.
    User takes his laptop home, writes 10+ mails and sends them, they lay down in outbox till tomorrow, where he comes to work, connects to network and then problems start to arise.
    Mails and attachments never exceed more than 1 or 2 mb's and its usually one at that size...
    Problem; user connects laptop to network and Outlook freezes for 15-30 minutes, later on unfreezes and mails are sent (it is sending them in freezed period), after that everything works just fine..
    I have reinstalled office, removed profile, checked for plugins there are none, problem still not resolved.
    Anyone has any idea?

    So no one has any idea, or maybe i used bad english, if so please ask i will clarify if missed something

  • Automatic mail sending for goods receipt

    Hello friends
    When a goods receipt against a PO (movement type 101) is done into any plant , an e-mail should be sent to ‘[email protected] ’ stating:
    Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
    Plz suggest how to do this.
    what are the tables that can be used
    wat are the fms that can be used etc
    where this can be configuered,, or done thru ABAP

    solved self. scheduled a backgound job. as no user exit and badi is available

  • How can I send SMS from Mobile To PC? Plz Help me...

    I created one Midlet that has the user interface to get the details from the user.
    I want to send those details to server as SMS.
    What can I do with WMA.How can I send SMS from Mobile to PC.
    Plz help me to send SMS from Mobile to PC.

    Hi Senthilnathan,
    I too try for the same, if anyone has the idea please reply
    Regards
    Karthi

  • Configuration need automatic mail to others users

    hi friends
    we have the requirement like if user change the price in the condition record ,automatically mail send to the user. then only user
    update in the sale order.
    note : purpose to losing the revenue of the company
    with reagrds
    dinesh
    Edited by: code acess on Apr 8, 2011 8:08 AM

    Hope the following SDN thread can assist you:
    - Mail trigger from VK11
    Thanks & Regards
    JP

  • JSP Send Mail Application, plz help

    Hi,
    I have written a jsp send mail application, but it is giving error that NoSuchProviderException. What to do? Plz help. I m sending the code as below:
    <%@ page import="java.util.*, javax.mail.*,javax.mail.internet.*" %>
    <html>
    <head>
    <title>E-Mail Us</title>
    </head>
    <body bgcolor="white" text="#003399" >
    <%
    if(request.getMethod().equals("POST") )
    boolean status = true;
    String mailServer ="SMTP_HOST";
    String fnm = request.getParameter("fnm");
    String lnm = request.getParameter("lnm");
    String facility = request.getParameter("facility");
    String subject = request.getParameter("select");
    String fromEmail = "[email protected]";
    String toEmail = "[email protected]";
    String bccEmail = "[email protected]";
    String contact =request.getParameter("select2");
    String way =request.getParameter("way");
    String messageEnter = request.getParameter("message");
    try
    Properties props = new Properties();
         props.put("mail.smtp.host", mailServer);
    props.put("mail.smtp.auth", "true");
    Session s = Session.getInstance(props,null);
    MimeMessage message = new MimeMessage(s);
    InternetAddress from = new InternetAddress(fromEmail);
    message.setFrom(from);
    InternetAddress to = new InternetAddress(toEmail);
         InternetAddress bcc = new InternetAddress(bccEmail);
         message.addRecipient(Message.RecipientType.TO, to);
    message.addRecipient(Message.RecipientType.BCC, bcc);
    message.setSubject(subject);
         message.setSentDate(new Date());
    message.setText(messageEnter);
         message.setText(way);
         message.setText(contact);
         message.setText(facility);
         message.setText(fnm);
         message.setText(lnm);
         Transport transport = s.getTransport(mailServer);
    transport.connect(mailServer, "USER", "PASSWORD");
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();
    catch(NullPointerException n)
    System.out.println(n.getMessage() );
         out.println(n.getMessage());
    out.println("<br><br><br><br><center><b>"+"ERROR!!!"+"</b></center>");//you need to enter a message"+"</b></center>");
         out.println("<br><br><center><b>"+"You need to Enter a message"+"</b></center>");
    status = false;
    catch (Exception e)
    System.out.println(e.getMessage() );
         out.println("<br><br><br><br><center><b>"+"ERROR!!!"+"</b></center>");
    out.println("<br><br><center><b>"+"Your Message to " + toEmail +" and "+ bccEmail+ " failed, reason is: " + e);
    status = false;
    if (status == true)
    out.println("<br><br><center><b>"+"Your message to " + toEmail +" and "+ bccEmail+ " was sent successfully!"+"</b></center>");
    else
    %>
    <center>
    <h1>Contact Us</h1>
    <form method="post" name="mail" action="mail.jsp">
    <table border="0">
    <tr>
    <td><b>First Name :</b></td>
    <td><input type="text" name="fnm" size=24></td>
    </tr>
    <tr>
    <td><b>Last Name :</b></td>
    <td><input type="text" name="lnm" size=24></td>
    </tr>
    <tr>
    <td><b>Facility :</b></td>
    <td><input type="text" name="facility" size=24></td>
    </tr>
    <tr>
    <td><b>Subject :</b></td>
    <td> <select name="select">
              <option>-------------------------------</option>
    <option>Missing File</option>
    <option>Correction Issue</option>
    <option>Refer Us</option>
    <option>Miscellaneous</option>
    </select></td>
    </tr>
    <p>
    <tr>
    <td><b>Comments :</b></td>
    <td><textarea name="message" rows = "10" cols="50"></textarea></td>
    </tr>
    <tr>
    <td><b>Best way to contact :</b></td>
    <td>
    <select name="select2">
              <option>--------------</option>
              <option>Phone</option>
    <option>Email</option>
    <option>Fax</option>
    </select>
    <input type="text" name="way" size=24></td>
    </tr>
    </table>
    <p>
    <font face="Helvetica"><input type="submit"
    value="Submit" name="Command">
    </font>
    </form></center>
    <%
    %>
    </body>
    </html>

    Ur messaging server will not be up..
    regards
    shanu

  • JSP send mail exception,plz help

    Hi,
    I have written code for mail program in jsp but it gives "javax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketException: Connection reset "
    what will be the reason for this plz help.
    thanks

    restart your machine then it s will be corrected...i mean socketexception
    i have found my problem...its a problem about delaying emails like spam protection...ur mail server and and script must run on the same ip...and so my problem solved...
    maybe there is a trick for delaying emails even they dont run under the same ip but i dont know..!

  • How to send automatic mail and put attache file on batch file ?

    how to send automatic mail and put attache file on batch file ?
    START MAILTO:[email protected]?SUBJECT=PHONE%CALL^&BODY=Testing

    Hi,
    Do you want to use a batch file to create new email message (including recipients, subject and email body) with attachments? If so, I'd recommend you post your question in the Scripting Guys forum for further assistance:
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Please feel free to let me know if I've misunderstood something.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • ITunes won't open - error message

    When I try and launch iTunes I get this error message:  "The folder iTunes is on a locked disk or you do not have write permissions for this folder."  I have since unistalled and reinstalled V 11. I have also been given admin rights to my machine. I

  • 8.3 filenames on classpath under Windows XP

    Hi, I have an application where the classpath may include paths with unicode characters. Since there is no obvious way to pass such paths to the JVM at startup, I have tried to convert the paths to the short (8.3) format prior to passing them to the

  • I don't want tabs in the bar when I leave pages. Like in 3.6: open in a new window.

    I don't want tabs of the pages I visit. I didn't get tabs in firefox 3 when i hand chosen for "open new page in new window". How do I get that in firefox 4 ??? Hernk.

  • Problem with using both group by and order by

    example: SQL> select * from orgchart; NAME TEAM SALARY SICKLEAVE ANNUALLEAVE ADAMS RESEARCH 34000 34 12 WILKES MARKETING 31000 40 9 STOKES MARKETING 36000 20 19 MEZA COLLECTIONS 40000 30 27 MERRICK RESEARCH 45000 20 17 RICHARDSON MARKETING 42000 25 1

  • Roxio Game Capture HD Pro, editing, Adobe premiere CC, M2TS, Audio wave form,

    Hello, fellows. So im having a bit of a problem, basically i cannot see the audio wave format when i edit my Roxio Game Capture Hd pro recordings, I've already tried converting the file to another format through the included video wave editor, but th