Problems with sending mail by javaMail with connection by proxy.

I want to sand mail by javaMail, from computer with connection to Inthernet with proxy (need login and passsword). There are DNS in connection (window's) to LAN.
When I try to send mail, exception occured: javax.mail.MessagingException: Connection refused: connect; nested exception is: java.net.ConnectException: Connection refused: connect
But NetBeans, for example, connect seccessfully.
My code is:
Properties props = new Properties();
props.setProperty("mail.smtp.host", "smtp.mail.ru");
props.setProperty("mail.smtp.port", "2525");
props.setProperty("mail.smtp.auth", "true");
props.setProperty("mail.user", "mymail");
props.setProperty("mail.password", "password");
Session mailSession = Session.getInstance(props, null);
try
Transport transport = mailSession.getTransport("smtp");
MimeMessage message = new MimeMessage(mailSession);
message.setHeader("X-Priority", "1");
message.setSubject("Message");
message.setContent(messageText, "text/plain; charset=UTF-8");
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(recepient));
message.setFrom(new InternetAddress("[email protected]"));
transport.connect("mymail","password");
transport.sendMessage(message,
message.getRecipients(Message.RecipientType.TO));
transport.close();
catch(Exception ex)
System.out.print(ex);
In Java control panel(Java Control Panel -> Network Settings) I check checkbox "Use Browser settings"
And try to add code before sendng:
System.setProperty("java.net.useSystemProxies", "true");
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyPort", "192.168.1.1");
System.setProperty("http.proxyUsername", "username");
System.setProperty("http.proxyPassword", "password");
System.setProperty("http.proxyAuthType", "basic");//System.setProperty("http.proxyAuthType", "digit");
But it don't work.
Edited by: CAPbl on Mar 14, 2010 10:07 PM

I novice in network programming and javaMail. Can you give me example or link to it? Thank you
Edited by: CAPbl on Mar 15, 2010 3:29 AM

Similar Messages

  • Problem in sending mail from database with attachment

    Hi All,
    I amd using forms10g,oracle10g
    I am facing a error while running a procedure to send mail from db
    procedure is:
    declare
    ErrorMessage VARCHAR2(4000);
    ErrorStatus NUMBER;
    -- enable SQL*PLUS output;
    --SET SERVEROUTPUT ON
    -- redirect java output into SQL*PLUS buffer;
    --exec dbms_java.set_output(5000);
    BEGIN
    ErrorStatus := SendMailJPkg.SendMail(
    SMTPServerName => '192.168.4.2',
    Sender => '[email protected]',
    Recipient => '[email protected]',
    CcRecipient => '',
    BccRecipient => '',
    Subject => 'hth106: Test JavaMail',
    Body => 'This is the body: Hello, this is a test that spans 2 lines',
    AuthReqdYNNum => 1,
    UserID => 'jagan',
    Password => 'songbirds',
    ErrorMessage => ErrorMessage,
    Attachments => SendMailJPkg.ATTACHMENTS_LIST('C:\oramail\MHTHSO_GEN45.html')
    END;
    while running this procedure i am receiving following error
    "ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.IncompatibleClassChangeError"
    but the same procedure sending mail from all other user in the same database
    I am very myuch confused.i have given the all rights
    below mentioned rights are given .it is working in all other user on the same db except this user "hth106". And all the othere things are compared between working user and this hth106 user every things are same.But i am receiving error when i sending mail with attachment if the mail is sending without attachement it is working fine
    below rights are given to this user
    1.exec dbms_java.grant_permission('HTH106','java.util.PropertyPermission','*','read');
    2.exec dbms_java.grant_permission('HTH106','java.util.PropertyPermission','*','write');
    3.exec dbms_java.grant_permission('HTH106','java.net.SocketPermission','*','connect');
    4.exec dbms_java.grant_permission('HTH106','java.net.SocketPermission','*','resolve');
    5.exec dbms_java.grant_permission('HTH106','java.io.FilePermission','C:\oramail\*','read');
    exec dbms_java.grant_permission('HTH106','java.io.FilePermission','C:\oramail\*','write');
    6.call dbms_java.grant_permission('HTH106','java.net.SocketPermission','HTHDS01','resolve');
    7.call dbms_java.grant_permission('HTH106','java.util.PropertyPermission','*','read,write');
    7.call dbms_java.grant_permission('HTH106', 'java.io.FilePermission','C:\oramail\*','read');
    please advise me to proceed further
    Thanks in advance
    Thanks ,
    Antony

    With respects to the following:
    The bit you'll have most diffulty with is the attachment, because you can't be sure that
    the directory path specified is one that the database can read from. You can probably
    resolve this by using some java to move the file to a directory which utl_file can see.Another alternative is to specify a location on then database server where all file attachments MUST be copied to and the define and Oracle DIRECTORY (CREATE OR REPLACE DIRECTORY [dir_name] AS '/dir/name/on/files/system';) that references this location. When you attach a file to an email, then you only have to refer to the DIRECTORY for the file location.
    Just my 2 cents on the topic. :-)
    Craig...

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

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

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

  • Problem of sending mail with MTA

    Hi,
    I have installed Sun Messaging Server, but I have a problem to send mail to other SMTP server over internet, like gmail, hotmail... So I have tried to send an email using javamail and I get this exception "530 5.7.1 Relaying not allowed", that mean that I don't have a Relay SMTP to routing the messages. But the idea that I have, is that the MTA installed with Messaging Server play the role of SMTP Relay.
    So this idea is true, so I think is can be I problem of configuration, and I need to have may own SMTP Relay and don't using ISP Relay.
    and I thank you for your help,
    Mabrouk.

    GS1-Tunisia wrote:
    21-Nov-2008 17:32:31.58 tcp_local                 Q 1 [email protected] rfc822;[email protected] [email protected] TCP active open: Failed connect()    Error: Connection timed out
    This indicates that Messaging Server is unable to connect to the yahoo mail servers.
    I have configured my server to use mydomain.com with ip 41.x.x.xHow did you configure your server to achieve this -- what settings did you add/change?
    but when I see this log [email protected] is converted to [email protected] and 192.168.3.2 is mailhost which is behind firewall in DMZ, So it may be the problem of NAT, I don't know!!!
    Given that Messaging Server cannot connect to the yahoo mail servers, the problem appears to be at the networking level so the firewall is most likely blocking the outgoing port 25 connection.
    When you are on the Messaging Server system, what output do you get for the following command:
    telnet a.mx.mail.yahoo.com. 25Regards,
    Shane.

  • Problem polling Inbox with Sender Mail adapter

    Hi,
    I have a funny problem with Sender Mail adapter (IMAP Protocol)
    It was working fine previously.
    Now, when I poll the Inbox, 2 things happen. After re-activation:
    1. If there is a new mail in the Inbox, the Communication channel marks the mail as read, but still keeps reading the same mail into XI.
    2. If there are no new mails in the Inbox, it reads the already read mails in the Inbox one by one. So all old mails start entering XI.
    This problem exists only with the Inbox. It works fine with other folders for the same mail ID.
    Any inputs as to why this is happening?
    Regards,
    Puloma.

    Hi,
    We re-started the server and problem was solved. But we don't know why the Adapter Engine was behaving erratically.
    Regards,
    Puloma.

  • Problem when sending mails with excel attached

    Hi
      I'm tryin to send mails via SAPOffice with attached excel documents. I'm using FM SO_NEW_DOCUMENT_ATT_SEND_API1. I have a problem with the code. Here I post it:
    DATA:  ti_objbin    LIKE solisti1   OCCURS 150 WITH HEADER LINE,
    ti_objhex    LIKE solix      OCCURS 150 WITH HEADER LINE.
    DATA: BEGIN OF i_excel,
    sobid(8) TYPE c,
    tab1 TYPE X VALUE 09, "tab code
    name(80) TYPE c,
    tab2 TYPE X VALUE 09, "tab code
    city(40) TYPE c,
    tab3 TYPE X VALUE 09, "tab code
    kostl(10) TYPE c,
    tab4 TYPE X VALUE 09, "tab code
    ktext(20) TYPE c,
    tab5 TYPE X VALUE 09, "tab code
    fasig(10) TYPE c,
    tab6 TYPE X VALUE 09, "tab code
    ruta(255) TYPE c,
    fin  TYPE X VALUE 13, "carriage return
    END OF i_excel.
    i_excel-sobid        = wa_datos-sobid.
    i_excel-name         = wa_datos-name.
    i_excel-city         = wa_datos-city.
    i_excel-kostl        = wa_datos-kostl.
    i_excel-ktext        = wa_datos-ktext.
    i_excel-fasig        = wa_datos-fasig.
    i_excel-ruta         = wa_datos-ruta.
    WRITE i_excel TO ti_objbin-line.
    APPEND ti_objbin.
    CLEAR  ti_objbin.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data              = docdata
    put_in_outbox              = 'X'
    TABLES
    packing_list               = ti_objpack
    object_header              = ti_objhead
    contents_bin               = ti_objbin
    contents_txt               = ti_objtxt
    *      contents_hex               = ti_objhex
    receivers                  = ti_reclist
    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.
    I have used this code before, in 4.6C release and it works fine, but now I'm on ECC5.0 and when i check the code, the next error message is generated: ""I_EXCEL" cannot be converted to a character-type field." If i try using MOVE i_excel TO i_objbin-line instead of WRITE, the error message changes to: ""TI_OBJBIN-LINE" and "I_EXCEL" are not mutually convertible in a Unicode program. program.". I have tried using ti_objhex table instead of ti_objbin in order to use 'context_hex' parameter (instead of 'context_bin') on FM, but i get the same result.
    I've been searching any other FM to do this, and i've found more FM of SOI1 function group but i didn´t get the expected result. So i need to send the message with the excel attached, using this FM or any other, but I need some help.  Anyone can help me?
    Thanks and Regards

    hi this is a simple example to send the excel sheet as a mail
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver .
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
      Retrieve sample data from table ekpo
      PERFORM data_retrieval.
      Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    FORM build_xls_data_table.
      data: ld_store(50) type c.  "Leading zeros
      CONSTANTS: con_cret(5) TYPE c VALUE '0D',  "OK for non Unicode
                 con_tab(5) TYPE c VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
       con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR' INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
    *Modification to retain leading zeros
      inserts code for excell REPLACE command into ld_store
      =REPLACE("00100",1,5,"00100")
        concatenate '=REPLACE("' wa_charekpo-ebelp '",1,5,"'
                                 wa_charekpo-ebelp '")' into ld_store .
      concatenate ld_store into .xls file instead of actual value(ebelp)
        CONCATENATE wa_charekpo-ebeln ld_store  wa_charekpo-aedat wa_charekpo-matnr  INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY
    regards,
    venkat.

  • Problem with sending mail throgh java mail api

    hi folks,
    We are having problem regarding sending mail using java mail api.
    we are using msgsendsample.java file from demo folder contained in javamail-1.3.3_01 folder.
    we are using following command at dos prompt.:
    java msgsendsample [email protected] [email protected] smtp.mail.yahoo.com false
    It gives following Exception:
    --Exception handling in msgsendsample.java
    com.sun.mail.smtp.SMTPSendFailedException: 530 authentication required - for hel
    p go to http://help.yahoo.com/help/us/mail/pop/pop-11.html
    at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1
    333) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:906)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:535)
    at javax.mail.Transport.send0(Transport.java:151)
    at javax.mail.Transport.send(Transport.java:80)
    at msgsendsample.main(msgsendsample.java:93)
    ** ValidUnsent Addresses
    [email protected]
    Thanking in Advance...
    Please give us guidance to any alternate solution if exists.

    hi
    the smtp server u are using should allow u to send mail to other smtp server like if u r sending mail to yahoo account u have to use yahoo smtp server only .....
    bye

  • I work in psd, i want to send mail to pdf,  with out pixel, how do i do ?

    i work in psd, i want to send mail to pdf,  with out pixel, how do i do ?

    Well it is difficult to understand your question so little information, and with an apparent language problem, but you can can Save As to the pdf format.  If you have any text layers, do _not_ flatten before exporting.  Use a High Quality Print preset in the PDF dialog box, unless file size is critical.
    If I have misunderstood your question, please give a lot more information, including what version of Photoshop.  You can use your own language if that is easier, and we'll use the forum Translate feature, but the more information you put in your post, the better chance of it being understood.

  • Problem: Cannot send mail unless Password is transmitted insecurely & Port is set to 587.. Can receive mail but can't send..

    Problem: Cannot send mail unless Password is transmitted insecurely & Port is set to 587.. Can receive mail but can't send Code 501..
    Need help with T-bird.. My OS is Win XP-64..Have been using Mozilla for about 10 years with little or no problems.. This happened when I upgraded to 3.17.. Spent hours on T-Bird diagnostics web site.. Called Comcast & talked to a net tech.. he ran some tests on his end & had me log into my Comcast e-mail account & all worked well,, so he concluded the problem was in T-Bird.. He had me change my port to 587 & disable connection security & authentication to none & I was able to send mail.. That was all he could do.. Comcast was working.. the problem is in T-Bird.. Can any one help with this problem.. I don't want to send mail with my password transmitted insecurely..
    Thanks
    Richard

    It was not intended to be "snide". You said two separate things that at face value would be out of the ordinary.
    I considered if it might be a typo for 31.7. Since 31.5 is the current formal release, I would have to thank you for volunteering to test a pre-release beta version. If it was truly 3.1.7 then it would appear that you have chosen, or have become stuck with a somewhat ancient version. In either case it's harder to reach out to you with any meaningful comments or advice. However I do watch various other sites and newsgroups and I don't see a clamour of distressed users, so it seems fair to suppose that this feature isn't actually broken in 31.7.
    And you said XP 64. XP is obsolete and no longer supported and if there is a 64-bit version, then again you have set yourself apart from the mainstream.
    I had a look at the comcast site and found some puzzling recommendations. Some users come here asking how to set up a secured connection in Thunderbird when it isn't offered by the server. Comcast are different, in that they mention the ports 143 and 587, and also 993 and 465. So far so good, in that security is actually on offer, but they also suggest that you enable SSL, regardless of which port is being used. It would be unusual and unconventional to offer TLS or SSL on ports 143 and 587. STARTTLS would be more credible on these ports.
    Have you tried IMAP on 993 and SMTP on 465? SMTP on 587 with SSL, or TLS, is not impossible, but is improbable.

  • Problem in sending mails to multiple persons

    Hi,
    I have a problem in sending mails to multiple people....
    My mail is using the local smtp server...The mail is to be send to multiple addresses in to and cc.
    for e.g the to address will have --> [email protected];[email protected]
    cc address will have --> [email protected];[email protected]
    How do this i.e set multiple to and cc address...
    My function that sends mail from my ejb looks like this...
    // create some properties and get the default Session
         Properties props = new Properties();
         props.put("mail.smtp.host", host);
         Session session = Session.getDefaultInstance(props, null);
         try{
         Message msg = new MimeMessage(session);
         msg.setFrom(new InternetAddress(from));
    //I HAVE TO SET MULTIPLE "TO" ADDRESSES HERE INSTEAD OF JUST 1
         InternetAddress[] address = {new InternetAddress(to)};
         msg.setRecipients(Message.RecipientType.TO, address);
    //I HAVE TO SET MULTIPLE "CC" ADDRESSES HERE INSTEAD OF JUST 1
    InternetAddress[] addresscc = {new InternetAddress(cc)};
         msg.setRecipients(Message.RecipientType.CC, addresscc);
         msg.setSubject(msgSubj);
         msg.setSentDate(new java.util.Date());
         msg.setText(msgText);
         Transport.send(msg);
         }catch (MessagingException ex) {
    System.out.println("\nException handling in javaMail.java :" + ex);
    Please help me out with a solution!!!Thanks in advance.
    Thanks
    Rahul

    Hi all,
    Got the solution...
    We have to use addRecipients method of the Message class to add as many receipts we want to set.
    example: Message.addRecipients(type,address).
    Thanks
    Rahul

  • Problem in sending mail from VF03

    Hi
    I am just getting a problem in sending mail to the recipient from script.
    please find the below code and let me know why there is no data in otf_tab table.
    DATA:  otf_tab TYPE TABLE OF itcoo WITH HEADER LINE.
    CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT  = i_itcpp
        TABLES
          otfdata = otf_tab
        EXCEPTIONS
          OTHERS  = 1.
    IF otf_tab[] IS NOT INITIAL.
          TRY.
              CREATE OBJECT mailer
                EXPORTING
                  i_nast = nast.
         mailer->get_mail_address( EXPORTING i_adrnr = vbdkr-adrnr ).
              mailer->get_mail_address( EXPORTING i_adrnr = vbdkr-adrnr
                                                     i_vkorg = vbdkr-vkorg
                                                    i_vtweg = vbdkr-vtweg ).
            zcl_sd_mail_output=>convert_otf_to_pdf( IMPORTING pdf_xstring =
            gv_pdf_string
                                                    CHANGING  otf_table   =
                                                    otf_tab[] ).
              mailer->build_and_send_email( EXPORTING pdf_xstring =
              gv_pdf_string ).
            CATCH zcx_sd_mail_no_mailid INTO error.
              error_txt = error->get_text( ).
              zcl_sd_mail_output=>protocol_update( msg_id = 'VN'
                                                   msg_nr = '902'
                                                   msg_ty = 'E'
                                                   msg_v1 = error_txt ).
              retcode = 1.
              CLEAR error_txt.
          ENDTRY.
        ENDIF.
    Since my OTf_tab is initial i am unable to send mails.

    Hi,
    If the OTF Data table is blank then you might have missed the parameter "GETOTFDATA" at the time of calling "OPEN_FORM". Please pass field TDGETOTF = "X" in paramter "OPTIONS" when you are calling "OPEN_FORM".
    You can also visit this link for more information.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556?QuickLink=index&overridelayout=true
    Cheers,

  • How to setup SMTP server  in PC so as to send mails using JavaMail

    Hi,
    From forums i got it cleared that we can use JavaMail to send emails. I also got two sample codes about getting it done. But in the code its asks address of the host of SMTP server. I dont have any SMTP server. But i am writing a Library Application in which an email must be sent to users automatically when thier books are in overdue.
    Where can i get SMTP server to be installed on my PC so that i can use it send mails through Javamail API.
    Thanks

    Isnt there any way setup SMTP server on own pc?? I just want to send mails in my local area network.

  • Problem in sending mail

    Hi all,
    I'm having some problem in sending mail. I did all configuration regarding this. After that when i tried to send mail, its giving some error, tht is, "SendMailService is not available".
    Can anybody help me on this.
    Thanks,
    Raj

    Hi Raj,
    Go to System Administrator > System Configuration > Knowledge Management > Content Management > Global Services > Mailing Service and make active option true, then restart your portal. Hope it'll work fine.
    Regards,
    Ganpati Jha

  • Problem in sending mail through dynamics actions

    Hi Friends,
    I have a problem in sending mail through dynamics actions . In this  we pass a subroutine in dynamics actions which send an mail when promotion action occured.
    Problem is that sometimes it will  send an mail or sometimes not. I have no idea to solve this problem.
    Can anyone suggest me .
    Thanks ,
    Anish
    Moderator message : Duplicate post locked.
    Edited by: Vinod Kumar on Sep 5, 2011 9:45 AM

    Hi,
    Check that all the bindings have been done in proper way as it is configured.. Try to do the binding manualy..This could also be the problem..
    thank You

  • PROBLEM IN SENDING MAIL TO POSITIONS THROUGH SEND MAIL STEP

    Hi Experts,
    I am facing some problems in sending mail to positions from the organization structure from the send mail step.When I am using user as the recipient type it is working fine...but when i am choosing S position as the recipient type it is giving the error in the workflow log stating that method SENDTASKDESCRIPTION cannot be executed.
    I need to find a solution urgently...any suggestion would be sincerely appreciated.
    thanks.
    Narsingh

    Well you have probably tried this.. but just a recheck.
    1 . send email setep select Organizational Object
    2. Recipient Type Organizational Unit
    3. Here do an F4 and then select the Unit...
    Try this SAP behaves weirdly at times...
    after this do Refresh Buffers.. and Org Unit...
    Let us know if this works

Maybe you are looking for

  • How Can I restore my MacBook Pro mid 2009 running OS X 10.8.6?

    I was wondering if I could restore my computer to make it run faster.  I only have about 570 MB of free memeory.  The only things I want to keep on my computer are my itunes music and thats about it really.  I was told I could spend $80 on 8GB of mem

  • IPad 2: How to assort photo-albums

    The Photo-albums are imported from my MacBook Pro (stored in iPhoto) via iTunes-sync. The name of the albums begin always with the date, e.g.: "20130112 +text...." I'd like to have a chronological order. Any hint for a solution most welcome Gerhard

  • Factory list menu implementation

    I'm building an application where I want to have a drop-down menu to select an object type (in this case an image filter, essentially) to create an object to append to a list. I thought to do it like this: <mx:XML format="e4x" id="dElevationProcessor

  • Override of PDF Functions in htmlLoader

    Is it possible to override functions in pdf forms processing called by htmlLoader? Specifically I want to pass a user password into the document programatically rather than having the dialog box popup. Would it be possible to extend the adobe reader

  • HT4628 airport express

    When installing Airport Utility in Mountain Lion, got error message 'Airport Utility can't be installed on this disk. The version of Mac OS X on this volume is not supported.'. Need help.