Email sending in WDJ

HI

Hi,
Use the below code and add appropriate jars...
public void SendTo( )
    //@@begin SendTo()
    try
     String host = "XXX.XX.XX.XX"; //specify the host ip here
               String from = wdContext.currentContextElement().getVa_MailFrom();
     //     wdComponentAPI.getMessageManager().reportSuccess("from" +from);
               String to = wdContext.currentVn_MailElement().getVa_To();
     //     wdComponentAPI.getMessageManager().reportSuccess("to" +to);
               String msg = wdContext.currentVn_MailElement().getVa_Body();
     //     wdComponentAPI.getMessageManager().reportSuccess("Body" + msg);
               String subject = wdContext.currentVn_MailElement().getVa_Subject();
     //     wdComponentAPI.getMessageManager().reportSuccess("Subject" +subject);
               String cc=wdContext.currentVn_MailElement().getVa_Cc();
               //           Get system properties
               Properties props = System.getProperties();
               //           Setup mail server
               props.put("mail.smtp.host", host);
               //           Get session
               Session session = Session.getDefaultInstance(props, null);
               //           Define message
               MimeMessage message = new MimeMessage(session);
               //          Sending mail to addresses in To field
               if(to!=null)
                    StringTokenizer st = new StringTokenizer(to, ",");
                              while (st.hasMoreTokens())
                                   String tempTo = st.nextToken();
                                   try
                                        message.setFrom(new InternetAddress(from));
                                        message.setRecipient(
                                             javax.mail.Message.RecipientType.TO,
                                             new InternetAddress(tempTo));
                                        message.setSubject(subject);
                                        message.setText(msg);
                                        javax.mail.Transport.send(message);
                                        wdComponentAPI.getMessageManager().reportSuccess("Mail sent to: " + tempTo);
                                   catch (AddressException e)
                                        e.printStackTrace();
                                        wdComponentAPI.getMessageManager().reportException(
                                             "exception in to",
                                             false);
                                   //          catch (MessagingException e) {
                                   //          e.printStackTrace();
                                   //          wdComponentAPI.getMessageManager().reportException(
                                   //          "exception in to Message",
                                   //          false);
                                   catch (Exception e)
                                        wdComponentAPI.getMessageManager().reportException(
                                             "exception: " + e.getMessage(),
                                             false);
Regards,
Srinivas

Similar Messages

  • Problem with replies in Maverick's mail.  Originating emails send fine.  When replying to an email (various addresses) the reply is hung up and can not be sent.  Option becomes put in draft, delete, etc.  Any suggestions would be helpful

    Problem with replies in Maverick's mail.  Originating emails send fine.  When replying to an email (various addresses) the reply is hung up and can not be sent.  Option becomes put in draft, delete, etc.  Any suggestions would be helpful.  Mid 2013 iMac.

    I don't know how rare this is.  I went a week or so without a problem, and now it's starting to recur.  Also, in some instances, an email will look unsent (remain in the outbox on the Treo), but it has been sent, and recipients are replying while I'm trying to figure out what is going on.  Further, it will send the same email over and over during this madness.
    This is a show stopper.  If there isn't a software fix soon, I may chuck this phone in the garbage.
    Post relates to: Treo 800w (Sprint)
    UPDATE:  The problem comes and goes.  The next day, no changes to the treo, everything workeds.  Now i'm suspecting the sprint server, and how it/the phone responds from failing to send while roaming.  I've since turned off roaming, and haven't had a problem for several days.
    Message Edited by slrichardson on 12-22-2008 01:12 PM

  • Email send/receive suddenly doesn't work ; can't change email settings as BB phone won't accept valid username and password -- what to do?

    email send/receive suddenly doesn't work (as of September 24th); I can't change email settings (one suggestion from tech) as BB phone won't accept *valid* username and password -- what to do?
    I understand from a support note that if I keep trying my password/username combination, my BB will eventually delete all data!
    I can't understand this. I'm completely lost now. I can't remember what I've done or tried to do. A plethora of usernames and passwords is swimming in my head.
    Thanks for any hints. I have always loved this BB Bold and have never had any trouble with it.

    But the real question is why for the past year did the passwords work and then all of the sudden after this anomaly the disk password doesn't work?  I'm not 100% sure of what my configuration was, but I know that most of the time it required one password -- supervisor, and occasionally it asked for 2 -- disk password as well I believe.  This may have been related to the Password on Restart setting I think -- asking for the disk password on cold vs. warm boot.  But I know both were exactly the same.  But after this incident only the Supervisor password worked.

  • PSE9 - having trouble with "html email sender verification" page

    We have just purchased the PSE9. This is our first venture into a photoshop program. We are wanting to send some of our pictures to friends via email. Just after we push the "share" button, to create an attachment for the email, we get this page "html email sender verification." It contains in the first blank, our email address (given), a button "resend email", and a blank entitled " Sender verification."  Below this box are the words:
    "If this email address is not correct, or you would like to use a different e mail client, you can change your email settings by clicking Cancel and then choosing
    Edit ->Preferences->sharing."
    At the bottom right are two buttons, "OK" and "Cancel"
    When we put in our email address into the "Sender verification" box,  and press "OK" the next window is entitled "HTML Email Sender Verification" .  The only words on the page for us are  in red and they say:
    "Your email could not be sent because an unkown error has occurred. Please try again."
    Then we have the option of pushing the "OK" or "Cancel" button.
    Can anyone help us get beyond this obstacle?
    THANKS!!

    You need to enter the email id in preferences. Once you put it, you will receive a verification code. You need to put this verificaiton code in the sender verification window. This is required if you are using Adobe email service. You can change the email provider from sharing preferences.

  • TS3899 After updating to ISO6, my email sending get extremely slow or dispeard. on the botton line of mail page always indicate "sending # of 9", however I do not know where to check or delete these unsent items. Please help! It has consumed lots of data.

    After updating to ISO6, my email sending get extremely slow or dispeard. on the botton line of mail page always indicate "sending # of 9", however I do not know where to check or delete these unsent items. Please help! It has consumed lots of data.
    I use @me.com and @hotmail.com

    Hi,
    >>A CHAR datatype and VARCHAR2 datatype are stored identically (eg: the word 'WORD' stored in a CHAR(4) and a varchar2(4) consume exactly the same amount of space on disk, both have leading byte counts).
    Ok, but on the other hands:
    SGMS@ORACLE10> create table x (name char(10), name2 varchar2(10));
    Table created.
    SGMS@ORACLE10> insert into  x values ('hello','hello');
    1 row created.
    SGMS@ORACLE10> commit;
    Commit complete.
    SGMS@ORACLE10> select vsize(name),vsize(name2) from x;
    VSIZE(NAME) VSIZE(NAME2)
             10            5
    SGMS@ORACLE10> select dump(name),dump(name2) from x;
    DUMP(NAME)                                         DUMP(NAME2)
    Typ=96 Len=10: 104,101,108,108,111,32,32,32,32,32  Typ=1 Len=5: 104,101,108,108,111Cheers

  • Email sender's name incorrect - can I change it?

    Emails I receive from one person are labeled as coming from "Verizon" instead of the person's name. I have the person correctly entered into my Contacts Book and I think that messages I send from my email are correctly addressed.  Can I edit the name of this email sender and, if you, how?  Thanks.

    Found the answer.  The problem was not at my end but in my Verizon friend's email settings.

  • Workflow Issue : Email sender display name not as the same as alert email sender

    Dear Support,
    we customized a workflow for sending alert to some user when someone create a new item in the specified document library. 
    what we already done as below
    1. the email sender address has been setup at "Central Administrator", for example "[email protected]".
    2. team site title is "Customer Center Platform".
    3. we customized a new workflow to trigger system send a email to recipient when someone create a new record.
    what we expected is 
    Recipient will got a email which send from "[email protected]", the email display name should be "Customer Center Platform [[email protected]]", but in this case, the display name is "[email protected]".
    it's been our experience that when we used "Alert Me" function, system will send the email and used "Customer Center Platform [[email protected]]" as email display name.
    we want to change workflow email sender display name, what can we do? we are looking forward to your advice, many thanks.

    Dear Hemendra,
    thanks for your reply.
    we follow the below guide to setup the workflow step by step
    http://blogs.msdn.com/b/publicsector/archive/2007/05/22/document-workflow-how-to-sending-an-email-with-sharepoint-2007-moss.aspx
    we used "Send an email" Action, the recipient can receive email, but the email sender's display name is "[email protected]",
    we want to change to "Customer Center Platform [[email protected]]".
    There is a native "Alert me" function under sharepoint team site, we compared the email sender display name, we found the display name in "Alert me" notification email
    is "Customer Center Platform [[email protected]]". 
    we have no idea what is wrong when we setup the workflow.

  • Is it possible to create a cc in email sending for dunning using 1040?

    Hi experts,
    Is it even possible to create a carbon copy of email sending using BTE 1040?
    I have been looking around and can't see any solution yet.
    Thanks.

    Hi James,
    Request you to go through the below link for checking the functionality.
    Email Output to Multiple Recipients Functionality in SAP
    If the same does not help you then please share the issue faced by you.
    Thanks,
    Vishal

  • Encoding issue in email send from SAP

    Hi,
    I am currently having encoding issue in email send by SRM .
    Can some one help me ?
    My problem :
    When i key in my SC subject/desc through IE7 with encoding unicode (UHT-8). Everything look fine.
    After i order the SC, Email will be sending out to the approver.
    The email received by approver is including strange character.
    Example desciption i putting on SC : Testing Encoding from IE7
    Result : Email which received by approver : Testing Encoding from IE7Â.
    Can some one advice me on this?
    Thanks,
    Vanece

    Hello Vanece,
    >
    Vanece Hee wrote:
    > (...)
    > They look fine in BBP_PD as well.
    >
    > when i trace them in SOST, the word will be look weird.
    > (...)
    Problem could come from internal and external data format.
    Depending on your SRM release, check OSS notes for report you used to generate approval mail ( RSWUWFMLEC, RBBP_NOTIFICATION_APP, etc.).
    >
    Vanece Hee wrote:
    > (...)
    > When i change the encoding setting in outlook to unicode for the email, it work for some email only.
    > (...)
    Ask to your Outlook team to have a look at Outlook settings.
    You can also check OSS note 1319517 - Unicode Collection Note.
    Regards.
    Laurent.

  • Hi, Using MAC OSX 10.6.8 and have intermittent issues with receiving new emails - sending is OK. I've tried the workarounds (take offline & take online), quitting mail etc - no luck. Any suggestions?

    Hi, I'm using MAC OSX 10.6.8 and have intermittent issues with receiving new emails - sending is OK. I've tried the workarounds (take offline & take online), quitting mail etc - no luck. Have cleared space, checked Window - Doctor and server has green light.  Mail Activity shows 47 emails waiting to download, iPad and iPhone download them all OK - no extra big files stopping the download either.    In the past, quitting mail has worked, but not today... Any suggestions?

    Hi, I'm using MAC OSX 10.6.8 and have intermittent issues with receiving new emails - sending is OK. I've tried the workarounds (take offline & take online), quitting mail etc - no luck. Have cleared space, checked Window - Doctor and server has green light.  Mail Activity shows 47 emails waiting to download, iPad and iPhone download them all OK - no extra big files stopping the download either.    In the past, quitting mail has worked, but not today... Any suggestions?

  • Why won't my imac email send unless I restart the whole computer?

    why won't my imac email send unless I restart the whole computer?

    Two things, first see if it shows up in "Apple > About This Mac > More Info.. > Disc Burning" . If you still see it there the system still recognizes it but it isn't responding. Next do a
    SMC RESET
    http://support.apple.com/kb/HT3964
    Shut down the computer.
    Unplug the computer's power cord and ALL peripherals.
    Wait 15 seconds.
    Attach the computers power cable.
    Wait another 5 seconds and press the power button to turn on the computer.
    The 5 second timing is important to a successful reset.
    Hopefully this will reset the power to the drive.

  • Excel attachment in external email sending

    Hi guys.
    Just having a bit problem in my excel attachment in external email sending (internet). The contents of my attachment are being considered as one column per line item, which is supposedly divided into columns according to its tab or space.
    example: i sent this :
    PO# Poitem
    A 1
    it will be displayed in excel as:
    column1
    PO# Poitem
    A 1
    it should be like this:
    column1
    column2
    PO#
    Poitem
    A
    1
    can anyone tell me what additional fm(s) do I need to implement before calling fm: SO_NEW_DOCUMENT_ATT_SEND_API1 to send the email.
    thanks a lot!
    cheers,

    jagan,
      Comapare your code with this program.
    I need a create a excel file (or tab delimited file) and send it as attachment by mail to the user (in background processing). I use SO_NEW_DOCUMENT_ATT_SEND_API1. I have a problem, that 1 Excel line is splited into 2 lines in mail, because there is more then 255 chars in Excel line.
    Can anybody help me?
    report y_cr17_mail .
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara  like selc occurs 0 with header line.
    data g_objparb  like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
      text(4096) type c,
       end of g_files.
    data : fold_number(12) type c,
           fold_yr(2) type c,
           fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
       user                            = g_user
       PREPARE_FOR_FOLDER_ACCESS       = ' '
    importing
       user_data                       = g_user_data
    EXCEPTIONS
       USER_NOT_EXIST                  = 1
       PARAMETER_ERROR                 = 2
       X_ERROR                         = 3
       OTHERS                          = 4
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number =  g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
      g_objhead,
      g_objpara,
      g_objparb,
      g_receipients,
      g_attachments,
      g_references,
      g_files.
    method1 = 'SAVE'.
    g_document-foltp  = fold_type.
    g_document-folyr   = fold_yr.
    g_document-folno   = fold_number.
    g_document-objtp   = g_user_data-object_typ.
    *g_document-OBJYR   = '27'.
    *g_document-OBJNO   = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes   = 'Manohar testing by program'.
    g_document-folrg   = 'O'.
    *g_document-okcode   = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes =  'Manohar testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = sy-uname
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
      FOLMEM_DATA        =
      RECEIVE_DATA       =
    File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append  g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header.

  • Pros and cons of using email sending package in oracle 8.1.6

    hi ,
    i would like to know the advantages /disadvantages of using email sending package from oracle 8.1.6
    compared to sending the same using say perl or php.
    iam developing a site in php/oracle8.1.6 , in which iam supposed to create a payement module.whenever a user
    register(for free trial or subscribing the site) i'll have to send him a welcoming mail.In addition to this iam also supposed to find out wether subscribers are paying cash at right time and if not send them reminder mails and other for related scenarios . i can do the same in Perl or PHP.but if iam not gaining much(say based on server performance or load) then i think i can go ahead with oracle package. when i tested it i found that its slow . what about the load that it may cause for the server (ours is linux ).
    please do give inputs on this

    Hi Ravi,
    Thanks for your reply.
    But I am specifically looking at pros and cons for web services. So the thread which you passed to me won't help.
    Regards
    Nitin.

  • Return Order output email send to Creator as PDF

    Hi All,
    Please let me know, how to configure Return sales order output as email send to creator(end user).
    Business don't want to send it to customer, They need it in their mailbox as PDF and later they will send it to customer when ever they wants...
    Please provide some solution on this issue.
    Regards,
    Sathiesh pillai.

    Hi,
    You need to configure the output determination for return order type. The "Internal Output (MAIL)" output type can be used. For sending PDF copy to user himself, the user data should be maintained as "mail partner".
    From what i read from your question, you want to send PDF file to user who logged into system to create return order. If yes, then the program need to pick user-id who logged into the system and use his/her email id as communication for sending PDF file. For this, minor code changes will be required to make mail partner defaulted to end-user and not look at customer account partners of the return order.
    If user going to be same for every return order, then you may use TVARVC variant table to store his/her email id and check that table while sending email.
    regards,
    Vaibhav

  • How do you change the position of email sender so that it's on the left (sender[from], subject and date received)

    How do you change the position of email sender so that it's on the left (sender[from], subject and date received)

    In the Thread Pane where your messages are listed?
    You see that bar with the labels "From", "Subject", "Date" and so on? Well, they are buttons. You can click on them to sort your messages. You can also drag them with the mouse left and right to reposition them, and you can drag their ends to change the column widths.
    These are standard computer actions; you can do all of this in Windows Explorer ("My Computer") too.
    In Thunderbird, a right-click on any of these buttons will reveal a pop-up menu where you can select and deselect the columns to control what is shown.
    More here: http://www.ramsden.org.uk/8_How_to_sort.html

Maybe you are looking for

  • Please help !!!!! my new Iphone 4 G  Itunes messed up the upgrade !!!

    Hi All, I bough t 3 weeks ago in argentina a new 4G, Ituenes told me there is a new IOS 4.2 upgrade I didnt read it well but it was around 600 mb download. so Itunes downloeded it and started to upgrade the phone but suddenley my phone is stuck in re

  • Fax and modem via Drop & Insert card (VWIC 2MFT-E1-DI)

    Currently installing pair of 2610XM rtrs with Drop & Insert cards (VWIC 2MFT-E1-DI) between them. At each side there is PABX connected via E1 to Drop&Inser card, and 2Mbs leased line between locations. Configured 15 CH for data and 15 CH for voice. D

  • ORA-01722 Error

    Hi, I'm creating a search page with 4 fields. 3 of the fields come directly from the database so those pose no problem. The last field is a custom field (say month number) which indirectly searchs a field in the DB. I'd like to pull out all records t

  • WiSM 7.0.240.0

                       Guyz while checking on all WCS in security tab , attacks detected and then wIPS Denial of Service Attacks also wIPS Security Penetration Attacks does that means i have build in Wips coz im confused when i try checking Wips profiles

  • Capturing right clicks in flash panels

    Is there a possibility to capture a right click in a Photoshop flash panel? When running a SWF in a browser you can right click to display a context menu, which can be populated with own items. But when running a flash panel in Photoshop and you righ