How to send mail to all the receipients in distribution list

Hi All,
As per my requirement I need to send error log in doc format.
I am using the help of following code suggested by someone in sdn.
Mehr Beispile unter BCS_EXAMPLE_* mit se38
Mehr Beispile unter BCS_TEST*     mit se38
DATA: SEND_REQUEST       TYPE REF TO CL_BCS.
DATA: SUBJECT            TYPE SO_OBJ_DES.
DATA: ATT_TYPE           TYPE SOODK-OBJTP.
DATA: IT_TEXT            TYPE BCSY_TEXT.
DATA: WA_TEXT            LIKE SOLI.
DATA: IT_BIN             TYPE SOLIX_TAB.
DATA: WA_BIN             TYPE SOLIX.
DATA: DOCUMENT           TYPE REF TO CL_DOCUMENT_BCS.
DATA: SENDER             TYPE REF TO CL_SAPUSER_BCS.
DATA: RECIPIENT          TYPE REF TO IF_RECIPIENT_BCS.
DATA: BCS_EXCEPTION      TYPE REF TO CX_BCS.
DATA: SENT_TO_ALL        TYPE OS_BOOLEAN.
Bytes der Datei
DATA: IT_LENGHT          TYPE SO_OBJ_LEN.
DATA: N10(10)            TYPE N.
START-OF-SELECTION.
  PERFORM MAIN.
  PERFORM RSCONN01_EXECUTE.
END-OF-SELECTION.
FORM MAIN.
  TRY.
Dokument erstellen (mit Anhang)
      SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
      PERFORM HEAD_CONT.
      PERFORM RAW_ATT.
Dokument (mit Anhang) setzen
      CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
Absender setzen
      SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).
      CALL METHOD SEND_REQUEST->SET_SENDER
        EXPORTING
          I_SENDER = SENDER.
Empfänger setzen
      RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
                                        'email@address' ).
      CALL METHOD SEND_REQUEST->ADD_RECIPIENT
        EXPORTING
          I_RECIPIENT = RECIPIENT
          I_EXPRESS   = 'X'.
Dokument senden
      CALL METHOD SEND_REQUEST->SEND(
        EXPORTING
          I_WITH_ERROR_SCREEN = 'X'
        RECEIVING
          RESULT              = SENT_TO_ALL ).
      COMMIT WORK.
Sende-Error abfangen
    CATCH CX_BCS INTO BCS_EXCEPTION.
      WRITE: 'Fehler aufgetreten.'(001).
      WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
      EXIT.
  ENDTRY.
ENDFORM.                    "main
FORM HEAD_CONT.
  CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
  ATT_TYPE = 'RAW'.
  SUBJECT = 'Betreffzeile'.
  WA_TEXT = 'First Line'. APPEND WA_TEXT TO IT_TEXT.
  WA_TEXT = 'Second Line'. APPEND WA_TEXT TO IT_TEXT.
  DESCRIBE TABLE IT_TEXT LINES N10.
  N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
  IT_LENGHT = N10.
  TRY.
      DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                I_TYPE    = ATT_TYPE
                I_TEXT    = IT_TEXT
                I_LENGTH  = IT_LENGHT
                I_SUBJECT = SUBJECT ).
Error abfangen
    CATCH CX_BCS INTO BCS_EXCEPTION.
      WRITE: 'Fehler aufgetreten.'(001).
      WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
      EXIT.
  ENDTRY.
ENDFORM.                    "HEAD_CONT
*&      Form  RAW_ATT
      text
FORM RAW_ATT.
  CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
  ATT_TYPE = 'RAW'.
  SUBJECT = 'Text Anhang'.
  WA_TEXT = 'First Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
  WA_TEXT = 'Second Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
Lenght of Att_Text
  DESCRIBE TABLE IT_TEXT LINES N10.
  N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
  IT_LENGHT = N10.
  TRY.
      CALL METHOD DOCUMENT->ADD_ATTACHMENT
        EXPORTING
          I_ATTACHMENT_TYPE    = ATT_TYPE
          I_ATT_CONTENT_TEXT   = IT_TEXT
          I_ATTACHMENT_SIZE    = IT_LENGHT
          I_ATTACHMENT_SUBJECT = SUBJECT.
Error abfangen
    CATCH CX_BCS INTO BCS_EXCEPTION.
      WRITE: 'Fehler aufgetreten.'(001).
      WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
      EXIT.
  ENDTRY.
ENDFORM.                    "ATT_RAW
But From this method I am not able to send the mail to the distribution list created.
Please suggest How this can be done.
I dont want to chang

Hi Smriti,
You can make changes like shown below. The changes are shown in the code format for your easy reference. You can remove the code in bold. This will work.
Mehr Beispile unter BCS_EXAMPLE_* mit se38
Mehr Beispile unter BCS_TEST* mit se38
DATA: SEND_REQUEST TYPE REF TO CL_BCS.
DATA: SUBJECT TYPE SO_OBJ_DES.
DATA: ATT_TYPE TYPE SOODK-OBJTP.
DATA: IT_TEXT TYPE BCSY_TEXT.
DATA: WA_TEXT LIKE SOLI.
DATA: IT_BIN TYPE SOLIX_TAB.
DATA: WA_BIN TYPE SOLIX.
DATA: DOCUMENT TYPE REF TO CL_DOCUMENT_BCS.
DATA: SENDER TYPE REF TO CL_SAPUSER_BCS.
DATA: RECIPIENT TYPE REF TO IF_RECIPIENT_BCS.
DATA: BCS_EXCEPTION TYPE REF TO CX_BCS.
DATA: SENT_TO_ALL TYPE OS_BOOLEAN.
Bytes der Datei
DATA: IT_LENGHT TYPE SO_OBJ_LEN.
DATA: N10(10) TYPE N.
data: it_recipients type standard table of ad_smtpadr.
data: w_recipients type ad_smtpadr.
START-OF-SELECTION.
PERFORM MAIN.
PERFORM RSCONN01_EXECUTE.
END-OF-SELECTION.
FORM MAIN.
TRY.
Dokument erstellen (mit Anhang)
SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
PERFORM HEAD_CONT.
PERFORM RAW_ATT.
Dokument (mit Anhang) setzen
CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
Absender setzen
SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).
CALL METHOD SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = SENDER.
Empfänger setzen
LOOP AT it_recipients into w_recipients.
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(w_recipients).
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
ENDLOOP.
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS('email@address' ).
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
Dokument senden
CALL METHOD SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
COMMIT WORK.
Sende-Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "main
FORM HEAD_CONT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Betreffzeile'.
WA_TEXT = 'First Line'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line'. APPEND WA_TEXT TO IT_TEXT.
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = ATT_TYPE
I_TEXT = IT_TEXT
I_LENGTH = IT_LENGHT
I_SUBJECT = SUBJECT ).
Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "HEAD_CONT
*& Form RAW_ATT
text
FORM RAW_ATT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Text Anhang'.
WA_TEXT = 'First Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
Lenght of Att_Text
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
CALL METHOD DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = ATT_TYPE
I_ATT_CONTENT_TEXT = IT_TEXT
I_ATTACHMENT_SIZE = IT_LENGHT
I_ATTACHMENT_SUBJECT = SUBJECT.
Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "ATT_RAW
where the internal table "it_recipients" contains all the e-mail addresses.

Similar Messages

  • Sending mail to all users in Messaging Server 5.2

    Hi,
    I'm trying to send mail to all the users in my mail server, but haven't been able to do it. I'm using a command called deliver which is found in /opt/iplanet/server5/bin/msg/store/bin . I've tried sending messages to all users but have been successful in sending only to one user. Got any ideas??

    To create a dynamic mailing list:
    http://docs.sun.com/source/816-6009-10/users.htm
    If you're familir with ldapmodify, you can locate the user's pab in the directory server, and remove what you find there, but, honestly, I'd talk to the user first.. . .. .
    A user can work around removal of such, very easily. Any mail client, and a copy/paste will do it.

  • How to send mails in HTML format from the send mail step of workflow?

    Hi,
    I have a requirement where I need to send mails in the html format from the send mail step of the workflows.
    But what I found out that the html tags are not renderd and as such the output is in plain text.
    I know that there is an alternative of using an activity step and use my own custom code from within there,But due to certain business constraints, I need to use the send mail step only.
    My SCOT settings are all right.
    Please let me know how it can be done.
    Thanks,
    Samrat.

    Samrat,
    It can't be done, you have to use your own activity step.
    What are these constraints that refrain you from doing that?
    Rgds,
    Patrick

  • How do I set up a mail group on mac mail?  All the advise on line seems to refer to 'address book' and I only have 'contacts'.  The guidance does not work when using 'contacts' - can anyone help me?

    How do I set up a mail group on mac mail?  All the advise on line seems to refer to 'address book' and I only have 'contacts'.  The guidance does not work when using 'contacts' - can anyone help me?

    Create a group and send mail
    http://www.dummies.com/how-to/content/how-to-create-a-basic-contact-group-in-mac -os-x-li.html
    http://www.macworld.com/article/1165582/how_to_email_groups_with_mail.html
    Best.

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        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 = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • How can i turn off all the mails that i recive when use any program form my iPad?

    How can i turn off all the mails that i recive when use any program form my iPad?

    Everytime i use the my ID recive an e Mail to inform me.

  • How to stop mail from recovering the same message over and over again to the extent that it has wiped out all start up disk memory?

    How to stop mail from recovering the same message over and over again to the extent that it has wiped out all start up disk memory?

    You need to find and delete (move to the Trash) the offline mail cache (.offline cache.) It's a hidden folder (files and folders with a preceding dot are hidden) inside the Mail folder (inside IMAP) in your user library. Since it's hidden, in order to see it run the following command in Terminal in Applications>Utilities. Hit return/enter once you have pasted in the command.
    defaults write com.apple.finder AppleShowAllFiles -bool true ; killall Finder
    To reverse this and hide all those hidden files and folders again
    defaults write com.apple.finder AppleShowAllFiles -bool false ; killall Finder
    Leave hidden files/folders enabled until you finish emptying the Trash so you know it's gone.

  • HT5625 I cannot send a text thru iMessage.  I followed the directions over and over again but can't make it work.  Also how can I find out all the apple ids I may have.

    I cannot send a text thru iMessage.  I followed the directions over and over again but can't make it work.  Also how can I find out all the apple ids I may have.

    A wet phone is out of warranty. This is considered user damage. Even if you were able to get it to start now, the chances of it working for long are slim. I suggest going to Apple and see about an OOW replacement. One for the iPhone 4 is only $149USD and it would come with a short warranty. It is a refurbished device and you would not be worried about encountering additional problems.

  • Mail to all the employess in the internal table.

    Hi Experts,
    I have a internal table where the employee IDs are saved.. I need to send a mail to all the employees in the internal table. How will i be able to send a mail from the function module SAP_WAPI_START_WORKFLOW? where will i pass the internal table values and what need to be put in the mail recepient part?
    Regards,
    Lavanya

    First, if you are ONLY sending e-mails, you need to look into solutions other than workflow.
    Still, since you already have the workflow, you can pass an internal table with a list of all e-mail addresses to the workflow:
    - Define a multiline container element (import parameter) in the workflow. You could utilize the current e-mail address field (just mark it as multiline.
    - Pass that multiline element as the recipient of the e-mail (you can click F4 on the recipient field and then select the blue-looking table field).

  • How to send mail to multiple users in workflow

    Hi
    I have created a workflow for vendor details.
    after filling all the vendor details the mail should be sent to all managers
    involved in workflow.Can anyone tell me how to assign this task of sending mails to all users in organizational unit.

    hi
    user 1 has mailbox open when the work item arrives, then to user 2 it will apprear to be already read.
    Try using a logical AND in the definition of the responsibilites, so that when only both user 1 and user 2 (assuming that there can be two users) read their emails the work item is regarded as complete
    also check with the following link..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c6456e89-0a01-0010-0189-a7961fe42034
    reward if useful
    regards
    dinesh

  • How to send mail to distribution list ?

    Hi Everybody,
    Pls let me know how to send mail to distributed list???
    Thanks & Regards,
    raju<b></b>

    Hi ,
      Use Function Module 'SO_NEW_DOCUMENT_SEND_API1'.
      U need to pass Distribution list to Receiver and 'C' to receiver type refer the below code for clarification.
    Determine the Distribution List.
            gv_rec_list-receiver = gv_distribution.
            gv_rec_list-rec_type = 'C'.
            APPEND gv_rec_list.
    Check if Distribution List is deleted.
            SELECT SINGLE objnam
                     FROM soid
                     INTO lc_objnam
                     WHERE objnam = gv_rec_list AND
                           dlitp  = lc_dli.
            IF sy-subrc = 0.
              CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                EXPORTING
                  document_data              = gv_doc_data
                  document_type              = 'RAW'
                  put_in_outbox              = 'X'
                TABLES
                  object_content             = gv_obj_cont
                  receivers                  = gv_rec_list
                EXCEPTIONS
                  too_many_receivers         = 1
                  document_not_sent          = 2
                  document_type_not_exist    = 3
                  operation_no_authorization = 4.
              CASE sy-subrc.
                WHEN '1'.
                 message i001(as) with 'TOO MANY RECEIVERS'.
                  EXIT.
                WHEN '2'.
                 message i001(as) with 'DOCUMENT NOT SENT'.
                  EXIT.
                WHEN '3'.
                 message i001(as) with 'DOCUMENT TYPE DOES NOT EXIST'.
                  EXIT.
                WHEN '4'.
                 message i001(as) with 'OPERATION NO AUTHORIZATION'.
                  EXIT.
              ENDCASE.
              Hope this might have helped you.
    Thanks,
    Prashanth

  • How can send mails using hotmail/rediffmail domain name?

    I have used the below code to send a mail using javamail API?Even when I am sending my application does not have notified any of error/exceptions,But the message is not reached to I have given receipient's address in the to field.
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Sendmail1 extends HttpServlet {
    private String smtpHost;
    // Initialize the servlet with the hostname of the SMTP server
    // we'll be using the send the messages
    public void init(ServletConfig config)
    throws ServletException {
    super.init(config);
    smtpHost = config.getInitParameter("smtpHost");
    //smtpHost = "sbm5501";
    smtpHost = "www.rediffmail.com";
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws ServletException, java.io.IOException {
    String from = request.getParameter("from");
    String to "[email protected]";
    String cc = "[email protected]";
    String bcc ="[email protected]";
    String smtp ="www.rediffmail.com";
    String subject = "hai";
    String text = "Hai how r u";
    PrintWriter writer = response.getWriter();
    if (subject == null)
    subject = "Null";
    if (text == null)
    text = "No message";
    String status;
    try {
    // Create the JavaMail session
    java.util.Properties properties = System.getProperties();
    if (smtp == null)
    smtp = "www.rediffmail.com";
    properties.put("mail.smtp.host", smtp);
    Session session = Session.getInstance(properties, null);
    //to connect
    //Transport transport =session.getTransport("smtp");
    //transport.connect(smtpHost,user,password);
    // Construct the message
    MimeMessage message = new MimeMessage(session);
    // Set the from address
    Address fromAddress = new InternetAddress(from);
    message.setFrom(fromAddress);
    // Parse and set the recipient addresses
    Address[] toAddresses = InternetAddress.parse(to);
    message.setRecipients(Message.RecipientType.TO,toAddresses);
    Address[] ccAddresses = InternetAddress.parse(cc);
    message.setRecipients(Message.RecipientType.CC,ccAddresses);
    Address[] bccAddresses = InternetAddress.parse(to);
    message.setRecipients(Message.RecipientType.BCC,bccAddresses);
    // Set the subject and text
    message.setSubject(subject);
    message.setText(text);
    Transport.send(message);
    //status = "<h1>Congratulations,</h1><h2>Your message was sent.</h2>";
    } catch (AddressException e)
    status = "There was an error parsing the addresses. " + e;
    } catch (SendFailedException e)
    status = "<h1>Sorry,</h1><h2>There was an error sending the message.</h2>" + e;
    } catch (MessagingException e)
    status = "There was an unexpected error. " + e;
    // Output a status message
    response.setContentType("text/html");
    writer.println("<title>sendForm</title><body bgcolor= ><b><h3><font color=green><CENTER>CALIBERINFO.COM</CENTER></h3>Your message was sent to recepient(s).<br><font color=red>"+"\n"+to);
    writer.println("<br><br><a href=e:/mail/javamail/mail.html>back to compose</a>");
    writer.close();
    Please any one help me out from this probs.
    Awaiting for yours reply,
    or give me a reply to: [email protected]
    Regards,
    @maheshkumar.k

    Hi,
    how can send mails using hotmail/rediffmail domain name?In your java application,you specified www.rediffmail.com as your
    smtp server.But that is the address of that website.Try will a smtp
    server instead.For a list of free smtp servers,please visit http://www.thebestfree.net/free/freesmtp.htm
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • Sending mail to all users

    Folks,
    In Communigate there was a default 'all' account which could be used to send mail to all users. I know I could set up a mailing list to do this but does the Apple Mail server have a built in option for sending an email to all users?
    /// kak
    powerbook   Mac OS X (10.4.7)  

    No there is no such option.
    You will either need to setup a mailing list or create an alias that forwards to all your users.
    Obviously both solutions require that you add new users to the mailing list or alias.

  • How to send mail in html format in jsp???

    Hello everybody,
    I have two jsp pages.In one page I have the heading like Date,Transaction.I am retriving data from my second jsp page.And I hae included the second jsp page to my first jsp page.How to send mail this content in html format.
    Thanks
    Srikant

    MimeMessage m = new MimeMessage(session);
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setContent(content, "text/html");this if u need to send a mail content as html

  • How to send mail with attachment

    Hi,
    How to send mail with word document as attachment in oracle pl/sql.
    kindly help me .
    thank you
    regards
    P Prakash

    create or replace procedure pdf_mail(
        p_sender     varchar2, -- sender, example: 'Me <[email protected]>'
        p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
        p_subject    varchar2, -- subject
    p_text   varchar2, -- text
    p_filename  varchar2, -- name of pdf file
    p_blob   blob     -- pdf file
    ) is
      conn      utl_smtp.connection;
      i number;
      len number;
    BEGIN
      conn := demo_mail.begin_mail(
        sender     => p_sender,
        recipients => p_recipients,
        subject    => p_subject,
        mime_type  => demo_mail.MULTIPART_MIME_TYPE);
      demo_mail.begin_attachment(
        conn         => conn,
        mime_type    => 'application/pdf',
        inline       => TRUE,
        filename     => p_filename,
        transfer_enc => 'base64');
        -- split the Base64 encoded attachment into multiple lines
       i   := 1;
       len := DBMS_LOB.getLength(p_blob);
       WHILE (i < len) LOOP
          IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
          ELSE
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, (len - i)+1,  i)));
          END IF;
          UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
          i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
       END LOOP;
      demo_mail.end_attachment(conn => conn);
      demo_mail.attach_text(
        conn      => conn,
        data      => p_text,
        mime_type => 'text/html');
      demo_mail.end_mail( conn => conn );
    END;
    ref:
    http://www.plpdf.com/23-1725.html
    Edited by: Mahanam on Jan 9, 2011 10:32 PM

Maybe you are looking for

  • Create Material Master Record with Text

    Hi, I am looking to create material Master Data via ABAP.  I currently have some code that creates the Master Data Characteristic value I want, but I need the text as well.  Can someone tell me what I need to do to add the text for the Master Data Ch

  • Certain website will load on other browsers but not the new Firefox

    I run a website for one of our school programs. It has always loaded fine in Firefox and IE, but once I (and others) updated Firefox to Firefox 45, now the center screen of the website remains blank. I noticed this problem also occurs in Google Chrom

  • Leopard take off iWeb

    I was installing Leopard to my Mac Mini and iPhoto etc. was ok, but iWeb was off. Why?? My iLife (was coming also, when I by Mini) is 6. Even I doesn't need iWeb very much I'd like it to be in my Mini.

  • Gallery for non .mac?

    Is Web gallery even an option for non .mac domains? I host my personal website on godaddy and am wondering if the coolness that is the new Web .mac gallery can be "published" to godaddy.

  • Epub formatting

    Hi. I am formatting a document to epub. The problem is, even when I insert a page break a page break does not appear in the ibook, epub document but does in a PDF. Does anyone know how I can format so that a page break occurs? Thanks.