I need to send an automated birthday greetings mail notification

hi all .. I have a requirement like.. I need to send an automated birthday greetings mail notification on every morning.. so I need a general code...for that
so pls any one help me thank you in advance

package notification;
import java.sql.*;
import javax.naming.*;
import javax.sql.DataSource;
public class Notification{
    /** Creates a new instance of Notification*/
    public Notification() {
    public static void main(String[] args) {
        try {
            String sql = "Select name, email from users where DATEDIFF(NOW(),birthday)=0)";
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            Connection conn = DriverManager.getConnection(
                    "jdbc:mysql://localhost/birthday?user=java&password=javajava");
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery(sql);
            while (rs.next()) {
                String theText = "Congratulations "+rs.getString("name");
                 new BirthdayMail("smtprelay.myserver.net", rs.getString("email"), "[email protected]", "Automatic notification", theText, "Birthday");
        } catch (SQLException ex) { // handle the error
            System.out.println("SQLState: " + ex.getSQLState());
            System.out.println(
                    "VendorError: " + ex.getErrorCode() + " " + ex.getMessage());
        } catch (Exception ex) { // handle the error
            System.out.println("Non-sql exception: " + ex.getMessage());
            ex.printStackTrace();
* BirthdayMail.java
package notification;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
public class BirthdayMail {
     * Main method to send a message given on the command line.
    public static void main(String args[]) {
        try {
            String smtpServer=args[0];
            String to=args[1];
            String from=args[2];
            String subject=args[3];
            String body=args[4];
            send(smtpServer, to, from, subject, body, "");
        } catch (Exception ex) {
            ex.printStackTrace();
        System.exit(0);
     * Constructor.
    public BirthdayMail(String s1, String s2, String s3, String s4, String s5, String s6) {
        try {
            String smtpServer=s1;
            String to=s2;
            String from=s3;
            String subject=s4;
            String body=s5;
            String personal = s6;
            send(smtpServer, to, from, subject, body, personal);
        } catch (Exception ex) {
            ex.printStackTrace();
     * "send" method to send the message.
    public static void send(String smtpServer, String to, String from
            , String subject, String body, String personal) {
        try {
            Properties props = System.getProperties();
            props.put("mail.smtp.host", smtpServer);
            Session session = Session.getDefaultInstance(props, null);
            // -- Create a new message --
            Message msg = new MimeMessage(session);
            // -- Set the FROM and TO fields --
            msg.setFrom(new InternetAddress(from, personal));
            msg.setRecipients(Message.RecipientType.TO,
                    InternetAddress.parse(to, false));           
            // -- Set the subject and body text --
            msg.setSubject(subject);
            //msg.setText(body);
            msg.setContent(body, "text/html");
            // -- Set some other header information --
            msg.setHeader("X-Mailer", "NotificationMail");
            msg.setSentDate(new Date());
            // -- Send the message --
            Transport.send(msg);
            //log.info("Message sent OK.");
        } catch (Exception ex) {
            ex.printStackTrace();
    public static boolean statusSend(String smtpServer, String to, String from
            , String subject, String body, String personal) {
        try {
            Properties props = System.getProperties();
            // -- Attaching to default Session, or we could start a new one --
            props.put("mail.smtp.host", smtpServer);
            Session session = Session.getDefaultInstance(props, null);
            // -- Create a new message --
            Message msg = new MimeMessage(session);
            // -- Set the FROM and TO fields --
            msg.setFrom(new InternetAddress(from, personal));
            msg.setRecipients(Message.RecipientType.TO,
                    InternetAddress.parse(to, false));
            // -- We could include CC recipients too --
            // if (cc != null)
            // msg.setRecipients(Message.RecipientType.CC
            // -- Set the subject and body text --
            msg.setSubject(subject);
            //msg.setText(body);
            msg.setContent(body, "text/html");
            // -- Set some other header information --
            msg.setHeader("X-Mailer", "NotificationMail");
            msg.setSentDate(new Date());
            // -- Send the message --
            Transport.send(msg);
            return true;
        } catch (MessagingException ex){
            log.error(ex.toString());
            return false;
        } catch (Exception ex){
            ex.printStackTrace();
            return false;
}and in cron.daily a script to daily execute the project:
#!/bin/sh
/usr/local/jdk1.5.0_06/bin/java -jar /home/admin/proj/notification/Notification.jar
exit 0

Similar Messages

  • Need to send an automated email

    hi all .. I have a requirement like.. I need to send an automated birthday greetings mail notification on every morning.. so I need a general code...for that
    so pls any one help me thank you in advance

    http://java.sun.com/developer/EJTechTips/2004/tt0426.html#1

  • Need to send the zip file to mail as an attachment

    i want to pick the zip file which consists some 2,3 files inside it. and send as it is to mail as an attachment.what i did is
    i have taken one zip file,,, "testing.zip" inside it i have "test1.txt" & "test2.csv"
    i created sender CC ,,in that i used module payloadzipbean and  unzipped and called the file adapter.. created reciever CC as mail ..used same payload module now here i zipped all the payloads.
    Result..i see the attachment coming as "test1.txt.zip" ..here i can see inside this zipfile my original file names as "test1.txt"&"test2.csv" as i enabled ASMA in both CC.
    issues:i am unable to get the original file name like "testing.zip" ,,
    can anyone help me in this.
    Regards,
    Loordh

    Hi  all,
    as i posted last time my requirement ,i am going with java mapping for my scenario. i am using this code .
    http://wiki.sdn.sap.com/wiki/display/XI/Dynamicfilenameforpass-through+scenario
    this is working perfect for zip file  (file to file) scenario. but my scenario is file to mail ..as i need to send this to mail package there it is throwing error.i am getting  "zip file name as attachment properly but when  i try to  open it is giving error in zip file." this is what i modied code ..i am able to see my messge in sender CC and reciever CC..any java experts please help on this.
    try {
    // create XML structure of mail package
    String output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    + "<ns:Mail xmlns:ns=\"http://sap.com/xi/XI/Mail/30\">"
    + "<Subject>" + mailSubject + "</Subject>"
    + "<From>" + mailSender + "</From>"
    + "<To>" + mailReceiver + "</To>"
    + "<Content_Type>multipart/mixed; boundary=\"" + boundary + "\"</Content_Type>"
    + "<Content>";
    out.write(output.getBytes());
    // create the declaration of the MIME parts
    //First part
    output = "--" + boundary + CRLF
    + "Content-Type: text/plain; charset=UTF-8" + CRLF
    //+ "Content-Transfer-Encoding: 8bit" + CRLF
    + "Content-Disposition: inline" + CRLF + CRLF
    + mailContent + CRLF
    //Second part
    + "--" + boundary + CRLF
    + "Content-Type: Application/zip; name=" + attachmentName + CRLF
    //+ "Content-Transfer-Encoding: base64" + CRLF
    + "Content-Disposition: attachment; filename=" + attachmentName + CRLF + CRLF;
    out.write(output.getBytes());
    //Source is taken as attachment
    copySource(in, out);
    out.write("</Content></ns:Mail>".getBytes());
    } catch (IOException e) {
    throw new StreamTransformationException(e.getMessage());
    protected static void copySource(InputStream in, OutputStream out)
    throws IOException {
    byte[] bbuf = new bytehttp://in.available();
    int bblen = in.read(bbuf);
    if (!(bblen < 0)) {
    //String sbuf = new String(bbuf);
    //String encoded = Base64.encode(sbuf);
    // replace all control characters with escape sequences
    //sbuf = sbuf.replaceAll("&", "&");
    //sbuf = sbuf.replaceAll("\"", """);
    //sbuf = sbuf.replaceAll("'", "&apos;");
    //sbuf = sbuf.replaceAll("<"<");
    //sbuf = sbuf.replaceAll(">", ">");
    out.write(bbuf);}}

  • Re-send a shared document - e-mail notification doesn't arrive

    Hi
    Great and stylish application this sharing prog. A question though :
    I uploaded a pdf-file and shared it with a friend via an e-mail notification (and link); I also sent the link to myself.
    Between the sending and the opening of the file by my friend (he has no account at the service) I changed the rights from open to restricted not knowing only users/members could open the link to a restricted file.
    He mailed me he could not open the file so I reset it to open and sent him the link again (with myself as cc). I don't know about him but I dit not get the second notification (the first link now worked without singing in).
    When I tested the sending of the same pdf to another mailbox of mine and myself in cc I got the link in the other mailbox but not in the cc-mailbox (same as the first link).
    So, once you have sent a file to a certain e-mailadress, it is impossible tot send it again ?
    thx
    Luc

    Hi Michelle
    - Put a "V" : I meant "check the box" in front of the e-mail address.
    - When I speak about "cc" I mean adding my own e-mail address after
    the one of the person with whom I want to share (to check whether the
    e-mail had been sent). This only works the first time. If I want to
    share the document again with someone else and put my e-mail address
    behind his/her address, the mail to myself never arrives (but the
    other person receives the mail).
    - I don't send from the desktop.
    grtz
    Luc
    2009/5/5 mcacbat <[email protected]>:
    Hi Luc,
    >
    Thank you for your update. I have a few questions.
    >
    I'm not sure what it means to put a "V" in front of your email address on the list? Do you mind explaining this to me?
    >
    Also, the Share UI doesn't have an "CC" option, which makes me wonder if you are sending out the files directly from the desktop version of Acrobat? I've been doing my testing using Acrobat.com exclusively...
    >
    Thanks for you help!
    >
    Michelle
    >

  • Request for quation need to send for my vendor through mail

    Hi all,
                 I ned to send to my vendor Request for quation through mail , in that mail my RFQ must be in Excel format, as i am SAP XI consultant , is it needed to use SAP XI for this hope there is some standard fuction for this , please help me in this
    Thanking ypu
    Sridhar

    as prepared to use SAP XI

  • Need to send an attachment with the mail to the distribution list

    Hi all,
    How do I send an <b>attachment</b> with the e-mail to a distribution list?
    I am using the FMs <b>SO_DLI_EXPAND</b> and <b>SO_OBJECT_SEND</b> to expand the distribution list and send mail to the distribution list respectively.I am getting the contents of the file in the email that is being sent. The file is being extracted from UNIX.
    However, the contents of the file has to go as an attachment.
    Please assist.
    Thanks and regards,
    Anishur

    Hello,
    You can do it like this...using SapScript:
    REPORT YMAIL.
    DATA: ITCPO LIKE ITCPO,
    TAB_LINES LIKE SY-TABIX.
    Variables for EMAIL functionality
    DATA: MAILDATA LIKE SODOCCHGI1.
    DATA: MAILPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: MAILHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
    DATA: MAILBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILREC LIKE SOMLREC90 OCCURS 0 WITH HEADER LINE.
    DATA: SOLISTI1 LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    PERFORM SEND_FORM_VIA_EMAIL.
    FORM SEND_FORM_VIA_EMAIL *
    FORM SEND_FORM_VIA_EMAIL.
    CLEAR: MAILDATA, MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
    REFRESH: MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
    Creation of the document to be sent File Name
    MAILDATA-OBJ_NAME = 'TEST'.
    Mail Subject
    MAILDATA-OBJ_DESCR = 'Subject'.
    Mail Contents
    MAILTXT-LINE = 'Here is your file, would you check it?'.
    APPEND MAILTXT.
    Prepare Packing List
    PERFORM PREPARE_PACKING_LIST.
    BREAK gpulido.
    Set recipient - email address here!!!
    <b>*MAILREC-RECEIVER = '[email protected]'.
    MAILREC-RECEIVER = '[email protected]'.
    MAILREC-REC_TYPE = 'U'.</b>
    APPEND MAILREC.
    Set recipient - email address here!!!
    *MAILREC-RECEIVER = 'BGIRALDO'.
    *MAILREC-REC_TYPE = 'B'.
    *APPEND MAILREC.
    Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = MAILDATA
    PUT_IN_OUTBOX = 'X'
    TABLES
    PACKING_LIST = MAILPACK
    OBJECT_HEADER = MAILHEAD
    CONTENTS_BIN = MAILBIN
    CONTENTS_TXT = MAILTXT
    RECEIVERS = MAILREC
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    submit rsconn01 with mode = 'INT' and return.
    CASE SY-SUBRC.
    WHEN 0.
    WRITE: / 'Result of the send process:'.
    LOOP AT MAILREC.
    WRITE: / mailrec-RECEIVER(48), ':'.
    IF mailrec-RETRN_CODE = 0.
    WRITE 'sent successfully'.
    ELSE.
    WRITE 'not sent'.
    ENDIF.
    ENDLOOP.
    WHEN 1.
    WRITE: / 'no authorization to send to the specified number of'
    WHEN 2.
    WRITE: / 'document could not be sent to any of the recipients!'.
    WHEN 4.
    WRITE: / 'no authorization to send !'.
    WHEN OTHERS.
    WRITE: / 'error occurred during sending !'.
    ENDCASE.
    ENDFORM.
    Form PREPARE_PACKING_LIST
    FORM PREPARE_PACKING_LIST.
    CLEAR: MAILPACK, MAILBIN, MAILHEAD.
    REFRESH: MAILPACK, MAILBIN, MAILHEAD.
    DESCRIBE TABLE MAILTXT LINES TAB_LINES.
    READ TABLE MAILTXT INDEX TAB_LINES.
    MAILDATA-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( MAILTXT ).
    Creation of the entry for the compressed document
    CLEAR MAILPACK-TRANSF_BIN.
    MAILPACK-HEAD_START = 1.
    MAILPACK-HEAD_NUM = 0.
    MAILPACK-BODY_START = 1.
    MAILPACK-BODY_NUM = TAB_LINES.
    MAILPACK-DOC_TYPE = 'RAW'.
    APPEND MAILPACK.
    Creation of the document attachment
    This form gets the OTF code from the SAPscript form.
    If you already have your OTF code, I believe that you may
    be able to skip this form. just do the following code, looping thru
    your SOLISTI1 and updating MAILBIN.
    PERFORM GET_OTF_CODE.
    LOOP AT SOLISTI1.
    MOVE-CORRESPONDING SOLISTI1 TO MAILBIN.
    APPEND MAILBIN.
    ENDLOOP.
    DESCRIBE TABLE MAILBIN LINES TAB_LINES.
    MAILHEAD = 'TEST.OTF'.
    APPEND MAILHEAD.
    Creation of the entry for the compressed attachment
    MAILPACK-TRANSF_BIN = 'X'.
    MAILPACK-HEAD_START = 1.
    MAILPACK-HEAD_NUM = 1.
    MAILPACK-BODY_START = 1.
    MAILPACK-BODY_NUM = TAB_LINES.
    MAILPACK-DOC_TYPE = 'OTF'.
    MAILPACK-OBJ_NAME = 'TEST'.
    MAILPACK-OBJ_DESCR = 'Subject'.
    MAILPACK-DOC_SIZE = TAB_LINES * 255.
    APPEND MAILPACK.
    ENDFORM.
    Form GET_OTF_CODE
    FORM GET_OTF_CODE.
    DATA: BEGIN OF OTF OCCURS 0.
    INCLUDE STRUCTURE ITCOO .
    DATA: END OF OTF.
    DATA: ITCPO LIKE ITCPO.
    DATA: ITCPP LIKE ITCPP.
    CLEAR ITCPO.
    ITCPO-TDGETOTF = 'X'.
    Start writing OTF code
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    FORM = 'YSEND_MAIL'
    LANGUAGE = SY-LANGU
    OPTIONS = ITCPO
    DIALOG = ' '
    EXCEPTIONS
    OTHERS = 1.
    CALL FUNCTION 'START_FORM'
    EXCEPTIONS
    ERROR_MESSAGE = 01
    OTHERS = 02.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    WINDOW = 'MAIN'
    EXCEPTIONS
    ERROR_MESSAGE = 01
    OTHERS = 02.
    Close up Form and get OTF code
    CALL FUNCTION 'END_FORM'
    EXCEPTIONS
    ERROR_MESSAGE = 01
    OTHERS = 02.
    MOVE-CORRESPONDING ITCPO TO ITCPP.
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
    RESULT = ITCPP
    TABLES
    OTFDATA = OTF
    EXCEPTIONS
    OTHERS = 1.
    Move OTF code to structure SOLI form email
    CLEAR SOLISTI1. REFRESH SOLISTI1.
    LOOP AT OTF.
    SOLISTI1-LINE = OTF.
    APPEND SOLISTI1.
    ENDLOOP.
    Reward points if helpful.
    Thanks
    Message was edited by:
            Pattan Naveen

  • How to send an automated email notification after dataloads complete.

    Please search the forums before posting
    Hi ,
    Hoq can we send an automated email notification once the daily data loads are complete.
    All the data loads are done through PC and after these got complete daily we need to send an automated e mail saying the loads are completed.
    Request your replies.
    Edited by: Arun Varadarajan on Mar 10, 2009 9:22 AM

    Hi,
    check this threads/links:
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/9bdd42cadf2878e10000000a155106/frameset.htm
    Process chains and Email alerts?
    process chain Email Notification
    E-mailing functionality on a process chain
    If you search SDN you will find much more...
    Regards
    Andreas

  • Need to send a an Outlook attachment with an Email

    Hello everyone ,
    I have a requirement in which I need to send an attachment in a mail as an Outlook attachment. I have used the following code and i am wondering what I would need to change so that the Outlook attachment works fine -
    public static void sendMessageWithAttachments(EmailPoller emailPoller,String body,String toAddresses,String ccAddresses,String subject, BlobDomain associatedEmail)
    throws MessagingException,Exception {
    Properties props = new Properties();
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    // Fill in header of the email
    message.setSubject(subject);
    message.setContent(message, "text/plain");
    if ((toAddresses != null) && (toAddresses.trim().length() > 0)) {
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(toAddresses));
    if ((ccAddresses != null) && (ccAddresses.trim().length() > 0)) {
    message.addRecipient(Message.RecipientType.CC,
    new InternetAddress(ccAddresses));
    // Create a multi-part to combine the Mime Body parts
    Multipart multipart = new MimeMultipart();
    // Create your new message part to set text inside email & add it to teh multipart
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(body);
    multipart.addBodyPart(messageBodyPart);
    // Create and fill MimeBodyPart for the attached content& add to multi part
    messageBodyPart = new MimeBodyPart();
    DataSource source = new ByteArrayDataSource(associatedEmail.toByteArray(),"text/plain");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("associatedEmail.txt");
    multipart.addBodyPart(messageBodyPart);
    // Associate the multi-part with message content
    message.setContent(multipart,"text/html");
    emailPoller.forwardMessage(message);//send email with attachments
    }What I tried was to set the MIME-type for the datasource @
    DataSource source = new ByteArrayDataSource(associatedEmail.toByteArray(),"text/plain");to application/vnd.ms-outlook but it does create an Outlook message as an atatchment but refuses to open it and shows an Error.
    Anyone who know how to make it work please ?

    Thanks a lot ... worked perfectly fine.
    DataSource source = new ByteArrayDataSource(<BlobHavingEmailDetails>.toByteArray(),"message/rfc822");
    messageBodyPart.setDataHandler(new DataHandler(source));
    //etc ... attach MimeBodyPart to MimeMultiPart to send the message with Body & attachment.Yes I wanted to attach another complete message to another one.

  • Send all the pdf with mail

    Hello!
    In my pdf's file, i have a button that send a xml file with the pdf's content, but i need to send all the pdf with mail, i need to send a .pdf file with mail, not an xml. Is it possible?
    Thank you

    put this script under a button
    event.target.submitForm({cURL:"mailto:[email protected]?subject=Submitted Form&body=Please find attached the completed form.",cSubmitAs:"PDF",cCharset:"utf-8"});
    [email protected]

  • Automator. Need to send multiple photos each by one email.

    Hello everybody.
    Help me please to create a task in Automator.
    I have 500 images of JPEG 12-15 MB size and I need to send each one to [email protected] one by one email.
    Since some mail servers have permit of size attachments not more than 20 MB - I can send only one image per one email.
    So the steps simply are:
    1) New mail
    2) enter email address
    3) add attachment (number 1)
    4) send
    Next
    1) New mail
    2) enter email address <<< same email
    3) add attachment (number 2)
    4) send
    Etc...
    Best regards,
    Art Fry.

    I had a similar problem and created a service to attach from finder to a new email and then I changed to Outlook and had to update it to do the same in outlook.
    open automator
    Under choose template select "service"
    At the top of script side will be the option "Service receives selected" set to "file" in "you can choose any application but since I only want this in finder that was my choice"
    select the mail program in automator so that the related actions are shown.
    if you use Mac Mail
    first select New Mail Message by dragging into the script.
    2nd select add attachment to front message.
    if you use outlook
    first select Create New Outlook Mail Message
    2nd Add Attachments to Outlook Messages
    save the scripted service with an appropriate name such as attach to email.
    From then when you right click in finder the option to "attach to email" (or whatever you named it) will be shown to activate your script.
    -J

  • HR: Need to Send the Paysilp as a PDF file through Mail to Employees

    Dear All ,
           Need to Send the Paysilp as a PDF file through Mail to Employees.
           can anyone please suggest any Standard Function Modules which takes the Payslip Form as input and convert it into PDF and can send it through mail to the concern employees.
          Can anyone please explain the procedure in detail.
    Thanks in Advance,
    Regards.

    venu,
    below is code which helps to generate pdf ,,,,hope u know how to use the mail sending function
    data:
    fm_name TYPE RS38L_FNAM, "Smart Forms: FM Name
    sf_name TYPE TDSFNAME
    value 'YOUR_FORM_NAME', "Smart Forms: Form Name
    P_OUTPUT_OPTIONS TYPE SSFCOMPOP,
    P_JOB_OUTPUT_INFO TYPE SSFCRESCL,
    P_CONTROL_PARAMETERS TYPE SSFCTRLOP,
    P_LANGUAGE TYPE SFLANGU value 'E',
    P_E_DEVTYPE TYPE RSPOPTYPE.
    data:
    P_BIN_FILESIZE TYPE I,
    P_BIN_FILE TYPE XSTRING,
    P_OTF type table of ITCOO,
    P_DOCS type table of DOCS,
    P_LINES type table of TLINE,
    name type string,
    path type string,
    fullpath type string,
    filter type string,
    guiobj type ref to cl_gui_frontend_services,
    uact type i,
    filename(128).
    GET SMARTFORM FUNCTION MODULE NAME ---
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = sf_name
    IMPORTING
    FM_NAME = fm_name
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    I_LANGUAGE = P_LANGUAGE
    I_APPLICATION = 'SAPDEFAULT'
    IMPORTING
    E_DEVTYPE = P_E_DEVTYPE.
    P_OUTPUT_OPTIONS-XSFCMODE = 'X'.
    P_OUTPUT_OPTIONS-XSF = SPACE.
    P_OUTPUT_OPTIONS-XDFCMODE = 'X'.
    P_OUTPUT_OPTIONS-XDF = SPACE.
    P_OUTPUT_OPTIONS-TDPRINTER = P_E_DEVTYPE.
    P_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
    P_CONTROL_PARAMETERS-GETOTF = 'X'.
    ****...................................PRINTING.........................
    CALL FUNCTION fm_name
    EXPORTING
    CONTROL_PARAMETERS = P_CONTROL_PARAMETERS
    OUTPUT_OPTIONS = P_OUTPUT_OPTIONS
    (....) <--- your form import parameters
    IMPORTING
    JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA.
    ****...................................CONVERT TO PDF...............
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
    BIN_FILESIZE = P_BIN_FILESIZE
    TABLES
    OTF = P_OTF
    DOCTAB_ARCHIVE = P_DOCS
    LINES = P_LINES
    EXCEPTIONS
    ERR_CONV_NOT_POSSIBLE = 1
    ERR_OTF_MC_NOENDMARKER = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    now you can mail the pdf.
    Reward points if helpful
    Regards,
    jinesh

  • Have Windows XP and Adobe 9 Reader and need to send a series of large documents to clients as a matter of urgency     When I convert 10 pages a MS-Word file to Pdf this results in file of 6.7 MB which can't be emailed.     Do I combine them and then copy

    I have Windows XP and Adobe 9 Reader and need to send a series of large documents to clients as a matter of urgency When I convert 10 pages a MS-Word file to Pdf this results in file of 6.7 MB which can't be emailed.  Do I combine them and then copy to JPEG 2000 or do I have to save each page separately which is very time consuming Please advise me how to reduce the size and send 10 pages plus quickly by Adobe without the huge hassles I am enduring

    What kind of software do you use for the conversion to pdf? Adobe Reader can't create pdf files.

  • TS2755 I used to get iMessages on my iPad 2 and iPhone 4 now it goes to one or the other, not both.  Icloud is not working for this and iMessage texting doesn't work I need to send it as a regular text. How do I fix this issue.

    Icloud doesn't work between my iPad 2 and iPhone 4. And when I try to iMessage from my iphone 4 it doesn't send. I need to send it as a regular text message. Any ideas why they won't sync and iMessage won't send?

    To delete, tap "Edit" (tap to enlarge image)

  • I need to send this email now!

    My story starts wih me trying to scan a picture from the printer to my computer. The printer scans: Photo to email. After ten minutes a new message window pops up with the scanned picture in it. I tried to copy it and paste it into my other email so that I could send it from there and thats when I started having problems. The computer started freezing up with the rainbow swirl. I tried to just send it from the origanal pop up email window, although it kept buffering and wouldn't let me send it. After at least 9 hours now I still can't send it! My computer is not buffering as much after I restarted it, but it still won't send the email with the picture! The email is in is in my outbox and each time I try to send it it just ends up in my outbox again! I've tried this multiple times already! I tried to just send an email to my iPod that just says: "Hi." ,but that won't work either! I need to send the email by the end of today because the contest ends today! It is for an art contest! Please help! I am only thirteen so if you try to explain and help me please don't try to use complicated words!
    Thank you so much!

    Welcome to Apple Support Communities.
    This will take a while to read.
    A very VERY long while.
    That's good, because in the meantime, your computer MIGHT fix itself and the email MIGHT send successfully.
    I know, I know you have this contest deadline...
    I. First things first.
    If there is an adult (parent, grandparent, teacher, nanny, caregiver, or college student) nearby, ask them for help.
    Now.
    Even if they CLAIM to know nothing about computers.
    They probably know a little SOMETHING about computers.
    That might even be helpful.
    Ask them.
    Now.
    II. Second, IF POSSIBLE print this whole message thread before continuing.
    Now.
    WHY?
    At some point you're probably going to turn your computer off, or at least quit the Safari browser app, (the one you're using right now to read this information), and then you won't be able to read these instructions to know what to do next until you turn the computer back on and re-open the Safari browser and return to Apple Support Communities and find this message again.
    If it doesn't print, don't panic.
    If there is another computer or iPad or iPod touch or iPhone or other smartphone nearby, locate this message thread Apple Support Communities in the browser: https://discussions.apple.com/thread/4165033?tstart=0
    If not, don't panic. You will probably be able to print later.
    III. So what is the problem?
    A. The 'rainbow swirl' as you call it (I call it a 'beachball'), most often happens when the computer gets really REALLY low on free RAM memory. RAM is the electronic memory chips located inside your computer. Those computer chips lose all their information when the computer power is turned off, IF the information isn't saved onto the hard disk first.
    To make more RAM memory available the first thing is to quit any other running apps that you don't need right now in your system Dock at the bottom of the screen.
    For example, if you have iChat or iMessage running, and Mail, and iTunes, and Safari, and iPhoto and your printer/scanner app, all you really need in order to scan and send your picture is your printer/scanner app, and Mail. So you can 'quit' all the other apps running.
    Command+click-ing (also known as 'right-clicking' if that option is enabled on your mouse or trackpad) on the running App icon in the dock will bring up the option to Quit.
    If the app is open on your screen, Command+Q will 'Quit' any app. If the app asks if you want to save unsaved information, choose 'Yes' to be certain that you're not deleting important information.
    If an app is 'stuck' (spinning rainbow swirly thing), the option MIGHT be available to 'Force Quit'.
    Quit all the other apps you don't need first.
    Do NOT Force Quit any apps just yet.
    B. It's possible that you are (also) very VERY short of hard disk space. That's the mechanical drive inside your computer that stores your Apps and your music and your pictures and emails and lots of other 'computer stuff' important to how your computer runs, magnetically, so you can bring it back later. It is where your apps are stored and your 'stuff' is saved.
    You think you MIGHT be able to erase some files to make more space available, but that's very VERY risky if you don't know what you're doing, so I don't recommend THAT.
    First, see how much free hard disk space you DO have available. Open Finder (the 'face' icon probably located in the system Dock at the lower left corner of your screen, and click on your hard disk drive name in the upper left column. (It's probably called 'Macintosh HD')
    At the very bottom of the Finder window there should be two numbers, one showing some number of items (not important) and another number showing how much hard disk space is available (important!):
    If you have less that 15.00 GB available, you are very short of hard disk space.
    That makes your system run slow or very slow, and can cause 'rainbow swirls' even if everything else is working correctly. We cannot do much about that right now if you're almost out of hard disk space.
    You will need some adult help to decide what could be erased to make more space available.
    If you share the computer with a parent or sibling, it's very risky to start deleting stuff.
    So don't delete anything now.
    C. It's possible that the file size of your scan exceeds the allowable maximum file size your email account can handle and has things all jammed up. On Hotmail.com, for example, the upper limit is 2.0MB (megabytes). Apple Mail (iCloud, .me or .mac) seem not to have that limitation.
    You said it took '10 minutes' to scan your picture. That sounds like your picture is scanned at a very VERY high resolution: 1200 or 2400 or 4800 or even 9600 dpi (dots per inch).
    That's great for working at home and for retouching photographs and for professional artists, but most likely, it is much MUCH too large to email to your contest.
    300dpi is probably a good maximum number for email. Check the contest instructions. They might want some other smaller number like 72dpi (internet web images) or 96dpi (Windows on-screen displays)
    A high dpi number means the scanned image takes up a LOT of space in RAM memory and when stored on your hard disk.
    That also means that it would take a very VERY long time to send that scanned file in email, although 9 hours is probably way WAY longer than it should take.
    D. READ THIS ONLY IF YOU ARE USING A "DIAL-UP TELEPHONE MODEM" to connect to the Internet.
    (Your adult should be able to help you determine this):
    A dial-up connection typically sends and receives information at up to 56Kbits per second. 
    Most people have something faster today.
    On my DSL internet account (pardon a bit of technical jargon, it's 3.0Mbit downloading (me downloading a music file from iTunes) and 512Kbit uploading (me sending a picture via email), sending one 2.0MB file can take 5 to 15 minutes. Sending the same 2.0GB file on a 56Kbps dial-up modem could easily take almost 10 times longer, or 50 minutes, up to maybe 2.5 hours. But that's still nowhere close to 9 hours.
    IV. OK. Got it. But my computer is still sitting there with spinning rainbow swirlies, and I have this contest deadline quickly approaching...
    What do I do to SOLVE this problem and get my picture emailed today???
    A. You've 'Quit' every unnecessary application?
    The only ones left should be the printer/scanner app, and Mail.
    Sometimes, that frees enough memory for things to begin working 'normally' again.
    So,while reading all of this, has your spinning rainbow swirly stopped and the computer returned to somewhat 'normal' function?
    YES - Check your Mail, Sent folder to see that your message finally got sent.
    Is your message with the picture in there?
    YES - Great. Problem solved. Have a great day. And next time, don't wait until the last minute to submit contest entries!
    NO? Check Mail, Outbox folder (Outbox is only visible and has a number showing IF there is something in the process of being sent, but not completed yet.)
    Is it in the Outbox?
    YES - It could be 'stuck'. You'll probably have to Force Quit the Mail program. That still MIGHT NOT clear your 'stuck' email with the email provider program though.
    B. Were you able to Force Quit all remaining programs?
    YES - Great. Now it's time to click , Restart.
    That will clear memory and reset things to get ready to try again.
    NO - If Force Quit doesn't work, then it's time for more drastic action:
    C. It's time turn the computer OFF.
    Why?
    Because there's likely other no way available to you to 'fix' what's still 'stuck'.
    WARNING: Turning the computer OFF shuts down EVERYTHING, and throws away ALL unsaved information in all apps that are still running but 'stuck'.
    THAT DOES SOUND DRASTIC!!!
    It is. But you have this contest deadline...
    D. If the adult you have nearby is NOT comfortable with you doing this, then STOP!!!
    You're going to miss your contest deadline.
    It isn't the end of the world.
    You're thirteen.
    There will be other contests and other opportunities.
    You're done until someone who IS comfortable helping you is there with you.
    Sorry.
    E. With your Adult's permission to turn off the computer, and with them standing or sitting next to you, hold down the computer power button for up to 10 seconds, until the computer screen goes black and the computer shuts off completely.
    WHEW!
    Take a deep breath.
    Tell your adult to start breathing again, too.
    (Blue adults passed out on the floor from a lack of oxygen aren't nearly as helpful as breathing ones.)
    V. OK. Now what? I still have this contest deadline and now I have XX minutes less because I've been following your long drawn-out instructions.
    HELP!
    A. Turn the computer back on.
    B. Wait for everything to come back up, and then log back in as you usually do.
    C. If you have a lot of programs set to start automatically, like iMessage or FaceTime or iChat or Safari or Mail...
    Use Command+Q to 'Quit' all of them NOW.
    Why?
    They all take available memory from the two programs you probably REALLY need at this point:
    1. Your printer/scanner and
    2. Mail, and
    3. maybe Safari, if you need to refer to these instructions again. Now you should be able to PRINT them, if you couldn't do that before
    If Safari normally opens with a WHOLE BUNCH (3 or more) of Tabs opening things like Twitter and Facebook and Instagram and Google and...
    Close EVERY open Safari tab except 1.
    D. Next, check to see if your printer/scanner app has saved your previous scan.
    I can't tell you how to do this, because I don't know what software you're running. Sorry.
    E. If you KNOW the filename**, locate your saved scanned image and open it using Preview and refer to the ADDENDUM below
    F. If you DON'T KNOW the filename, try re-opening the printer/scanner app.
    G. If you CAN'T FIND the file in three minutes or less, it's probably quicker to re-scan your picture than to spend more minutes looking for the last scan.
    H. Use your printer/scanner software to scan the file AT 300 dpi
    AND
    I. SAVE THE FILE TO YOUR DESKTOP, because it's MUCH easier and MUCH FASTER to find a new scan at the right resolution saved to your desktop than to 'fix' some huge image saved at the wrong resolution* in some file directory called My Computer/My Documents/My Printer/My Scanner/My Scanner App/2012/Aug/1/jpg/miscellaneous/Image_2952.png
    J. Don't let the scanner program TRY to automatically send it via email again.
    Do it yourself:
    K. Open Mail (assuming it's all set up). If not, open Safari, and navigate to your email site like Yahoo, Hotmail, GMail...)
    L. Select New Message or equivalent
    M. Enter the email address you're sending your contest entry to.
    N. Enter the Subject name the contest rules tell you to use.
    O. Enter all the information you're required to submit for the contest.
    P. NOW, attach the scanned image you just saved
    Q. You saved the scan to the Desktop.
    W. You might need to click Desktop icon in the left column to get the list.
    X. Click on your image filename and click the blue Choose File button to attach it.
    Y. Double-check everything to be certain you've included all the needed information AND your scanned picture.
    Z. Click 'Send'
    Check to be sure the message goes. On my MacBook, I hear the 'jet flyover' sound when mail goes out successfully.
    You can start breathing again.
    (And nearby your Adult helper can too.)
    You're welcome!
    ADDENDUM:
    ** THE "YES, I DO KNOW THE FILENAME AND DID FIND THE FILE AND OPENED IT WITH Preview..." instructions
    THIS is how to 'FIX' your huge picture file scan so it will be smaller, and send faster, and not get 'stuck' because your email account cannot handle a huge file, so 'OK, I'M REALLY DESPERATE HERE', BUT LIKELY TO CAUSE A LOWER-QUALITY IMAGE:
    A. Find the scanned filename in Finder.
    B. Double click on the filename.
    C. That should automatically open the file in Preview.
    D. Select Tools, Adjust Size.
    E. Scroll down to the bottom of the menu and select the Fit Into to largest size image available.
    On my computer it is 1920 x 1280 pixels.
    F. Now set the Resolution to 300 dpi.
    You'll have to type in the numbers.
    G. At the bottom left of the Resulting Size box, you should see two numbers, the 'was   MB' (original scan file size to the right), and the new   KB to the left, in both pixels and KB/MB.
    H. Your goal is to adjust the size to make the new resulting file size listed at the bottom left about 1.0MB or LESS. In my example, I reduced a 5.7MB photograph to 615KB (nearly a 90% reduction in file size, but with some loss of image quality).
    I. Then, click the OK button to make the change.
    J. Now in the top menubar, click File, Save As. That saves your changes, but still keeps the original file unchanged, so you can go back to it and try resizing it again without scanning it again, if you don't like the results.
    K. Now another screen pops up, asking you the name of the file
    L. Add 'resized' to the name of your file, so you know which one is the original and which has been changed.
    M. Notice that there is a slider labeled Quality.  Right now, it is probably about 3/4 of the way to the right.
    Sliding it all the way to the right will increase quality AND increase the file size.
    N. Try moving the slider to the right, and release it to see the change in file size.
    O. Remember, our ultimate goal is a modified scan file SMALLER THAN 2.0MB.
    P. When you're satisifed with the file size and the quality slider, click the blue Save button.
    Q. Now, try emailing the 'filename'-resized image you just saved.

  • What information do I need to send in my IPod touch to be replaced and how do i get the box to ship it in

    What info do i need to send in my ipod touch to be replaced (i still have the 1 year warranty) and how do i get the box to ship it in also I have no clue what the address is please help

    The instructions on how to obtain warranty work is covered here:
    Apple - Support - iPod - Service FAQ

Maybe you are looking for

  • How do i get past "waiting for activation" on iphone 3 ?!?!

    i've been trying since last night to get it working. my cousin gave me her old iphone 3 to use as an itouch and i am trying to get imessage to work, but it won't stop saying "waiting for activation". i've tried everything, i've tried veryfying my ema

  • Unable to update Jist in gui!!! here s the pseudocode. neglect earlier post

    package test; public class newdialog extends JDialog { JList and JScrollpane decalred here private void jbInit() throws Exception {                     list initialised here and added to scrollpane public static void main(String args[]) SwingUtilitie

  • What exactly does the email do sent by apple?

    I don't really understand what data they are collecting and in the email they want us to send them 3rd party apps we are using, how do I do that?

  • ATTRIBUTE_IDOC_METADATA : Sender not in payload

    Hi all when i am doing this: file-> XI -> IDOC I got this error <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Call Adapter   --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/e

  • Content accessible only in application, not in UCM

    Hi, is it possible to create such environment, that user can access some content only in application (custom portal and/or webcenter spaces) but not in UCM? Content should be obviously stored in UCM. I have no experience with task like this, please p