APEX_MAIL.SEND to mutiple email addresses stored in DB

Hi,
I want to send an email to several users which are stored in db users table. And another set of user emails will be cc'ed depending upon their roles. I am able to send the email to one person, cc to another. But how to add mutiple recipients in the 'p_to' and 'p_cc' parameters, which take comma separated email ids. So, basic problem is in creating comma separated emails list which are returned from the select query.
For sending email to mutiple recipients, i can loop on a cursor and send mails APEX_MAIL.SEND() inside that loop, But this doesn't make sense as APEX_MAIL.SEND is used to send the same email multiple times. Also, there should be a group of people who have to be cc'ed.
How to handle this?

basic problem is in creating comma separated emails list which are returned from the select query.You can easily do that in one query with LISTAGG (available in Oracle 11g):
with emails as
(select '[email protected]' email from dual
  union all
  select '[email protected]'       from dual
  union all
  select '[email protected]'       from dual
select listagg(email, ',') within group (order by email) as emaillist
from   emails ;
EMAILLIST
[email protected],[email protected],[email protected]

Similar Messages

  • Emailing Reports to the email address stored for the user in OID?

    Hi
    I have what seems like a simple enough question.
    We have an Oracle Forms / Reports Application running on IAS 10.1.2.2.0 on Windows. We use Single Sign On for Forms and Reports. We generate reports from forms using RUN_REPORT_OBJECT.
    I want to be able to generate a report and send it as an email attachment to the email addressed stored in OID for the SSO user running the forms application.
    I can set the REPORT_DESNAME to be the recipient email address (as documented).
    My question is do I have to query OID manually to get the email address (using DBMS_LDAP or whatever DB utility packages) and set REPORT_DESNAME, or is there a way that Forms (or Reports) can take of this automatically for me?
    Thanks

    You can go through portal to get your info by utilizing wwsec_api.person_info call or you can go after it using DBMS_LDAP. You have to do a bunch of work if you use DBMS_LDAP or DBMS_LDAP_UTL...like connecting, binding, getting a handle, etc. You ultimately can use DBMS_LDAP_UTL.get_user_properties.
    Look here for more details.

  • How send SMS to email address - can't fnd "@"

    On my other phones I have had I can specify an email address as the recipient of an SMS message. I can't figure out how to do that on the iPhone if the recipient's email address is not already saved as my contacts, mainly because I cannot find the symbols like @ and . that are needed for an email address. I would like to know how to type in an email address on the fly in the "To" of an SMS message.
    Thanks!
    Jenn

    Also to clarify a bit more. Your old phone actually never did send a SMS to an email address. SMS can only go to numbers (phone numbers or special numbers like American Idol uses for voting). That is just how the protocol works.
    What your old phone did was mix SMS and MMS together and allowed you to enter an email because MMS allows email addresses. Thus you were really sending an MMS (even if you didn't include a picture and just put text).
    So, this is why the iPhone since the SMS app is just for SMS only allows the characters it allows for the SMS protocol. If you want to send to an email address, you will have to use your email program.

  • Need my conformation details send to my email address please

    I order a all in one officejet pro 8610 printer but i order it over the phone and the representitive who made the ordr put in the wrong email address and I Need my conformation details send to my email address but the thing is once I've made the purchased and the order is ship I cannot fix my email from there so I need to know what I can  do to change my email address and for them to send my conformation details to me. please help thanks

    Call AppleCare & ask to talk to "Account Security". Contact numbers here:
    http://support.apple.com/kb/HT5699?viewlocale=en_US

  • HT5557 since i updated my Apple ID with correct email address I can now only send imessages to email addresses and not iphone numbers - any idea how to fix this problem ?

    since i updated my Apple ID with correct email address I can now only send imessages to email addresses and not iphone numbers - any idea how to fix this problem ?

    You might want to try contacting Apple for assistance by going to https://expresslane.apple.com, then click See All Products and Services>iTunes>iTunes Store>Passwords & Security Questions>Lost or Forgotten Apple ID password.  They should be able to explain what's going on and help you reset the password for the old ID if necessary.  The call should be free.

  • HT201363 I am trying to reset my security questions but it won't send to my email address

    I am trying to reset my security questions but it won't send to my email address

    If you already have a valid rescue email address, send the email to it, wait a few hours, and check the spam filter. If you don't, use the instructions in that article to contact Apple as if you had one security question and lost the Apple ID password.
    (88619)

  • My outlook is sending two invites in the icloud calandar. How can I stop this? I ony want the email send with my email address not the apple email

    My MS outlook on the PC is sending two invites in the icloud calandar. How can I stop this? I ony want the email send with my email address not the apple email.

    My phone is the 4.  Not the 4s. And I went there but it's nowhere the option to delete from server.
    I only see: ask before deleting and it's on. 

  • How do i always send from one email address, even when replying?

    Hello all
    I just moved to MAIL after 12 years of Eudora.
    I’m MAIL 2.1.3 in Mac OS 10.4.11 PPC.
    my problem
    People send emails to me at 2 different email addresses. Both of them are stored on two different servers, and thus two different POP setups. Let us call them Eunice.net and Poppy.net
    I have MAIL setup to pull my emails off both different servers. I think it would be best to always send emails from one particular email address, ([email protected]) using the one particular email POP server. (Eunice.net)
    My problem is that when I get an email sent to me at Poppy.net, want to hit reply and have it go out by way of the Eunice.net SMPT (POP) server (and with the return address as [email protected]
    The problem is that I can’t find a way to configure my Preferences/Accounts to make this happen. As of now, I hit reply to an email sent to [email protected]… and it tries to send the email out via Poppy.net (and fails) - i get an error messsage.
    Thanks for any help!

    Mail, Preferences, Composing, Send New Mail from is indeed set properly - so this is why i'm baffled.
    Note that this setting is "Send New Mail from", in other words, when you create a New message, not Reply to an existing message. When you create a new message, does it do send from the specified account? Note that this will only work if no message is selected, else it will create the new message using the account of the selected email (assuming Mail can figure out the account from the header).
    The following is copied from the Mail help (note how it handles New messages and Replies differently):
    *+How is the "From" address determined in a new message or a reply?+*
    +Mail will try to determine the correct "From" address to use when you compose a new message or reply to a message.+
    *+When you compose a new message, the From address is selected in the following order:+*
    +If a message is currently selected, Mail uses the account the message belongs to, if it can be determined from the headers of the message, or by the IMAP mailbox the message resides in.+
    +If an IMAP mailbox is currently selected, Mail uses the account the IMAP mailbox belongs to.+
    +If no message or mailbox is selected, Mail uses the email address for the first account listed in the Accounts pane of Mail Preferences.+
    *+When you reply to a message, the From address is selected in the following order:+*
    +The To and Cc fields are compared to email addresses you have set up in Mail Preferences. Mail uses the first matching address it finds as the reply address.+
    +If the message is in an IMAP mailbox, Mail uses the email address for the account the mailbox belongs to.+
    +If all else fails, Mail uses the email address for the first account listed in the Accounts pane of Mail Preferences.+
    One way to ensure that the messages are sent using the Eunice.net SMPT (POP) server is to set that server as the SMTP server in your Poppy mail account (putting your Eunice settings in the SMTP server settings dialog). That won't address the ReplyTo issue (although you can set that manually in the ReplyTo field, accessed via the button next to the subject line).
    Hope this helps...

  • How do I see a list of all my Apple Mail contacts. I do not use address book. I just want to see all the email addresses stored on my Mac

    Hi All,
    I have been using Mail for the past three years without need to send a regular mailing list mailout.
    I now need to send group emails and all I want to do is browse my contacts aquired over the last three years to create a list. I have not used Address Book for anything other than phone contacts so please do not point me in that dirrection.
    There must be a list of all email contacts stored somewhere on the Mac that I can look through. It is an almost impossible task to do this by browsing my inbox/sent folders.
    Hope you can help and thanks in advance!
    Best
    Adam

    0. find the user id.
        a. log in as that specific user.
        b. run terminal
        c. type "echo $UID"
        d. write down the user id that will be displayed
    1. Go to the finder
    2. go to the user home folder
    3. click the box with the magnifying glass (upper right corner of the window)
    4. type .jpg
    5. a menu will pop under the magnifying glass box, select "jpg image"
    6. click the "plus" sign that's displayed to the right of the word "save"
    7. two pull down menus will appear, select "other" from the first one
    8. a new window will pull down, scroll to "owner" and select it
    9. back in the original window type the user id (a number) to the right of "owner" "equals"
    Hope this helps

  • My iMessages will no longer send from my phone number and send from my email address instead. How do I fix this?

    My Iphone is sending imessages from my email address. I can see that my phone number is stored in the sned/receive option in imessage but it will not allow me to select the number for messages to be sent from my phone number instead of my email address. How can I fix it?

    Have you tried to sign out of your apple I'd and sign back in to associate your apple ID with your phone number?

  • When I try to go to the photo gallery to choose a picture to send to my email address by using my Iphone it can't send or receive messages. Yahoo password is being asked which I have forgotten. How can I correct this?

    With my my I phone as I try to choose a picture from the photo gallery to send it via email using my Iphone, I can't seem to send nor receive messages anymore. It is asking for my yahoo password. What password will that be as I have forgotten it. I know what my personal password on my yahoo address when I go to a regular laptop or desktop but with Iphone I am unable to to retrieve this password because it does not give you an option to change a password. What shall I do to correct this problem?

    It's the same password.  Go to settings - mail - yahoo - enter the password for your incoming and outgoing mail server.

  • How do I send from different email address

    I would like to use a clients email address when I send out thier survey form.  It is more recognizable and less likely to get caught is spam filter compared to using my email address.

    Thanks for your response.  I am using the distribution function within FormsCentral.  I guess what you are saying is that if I send my email invite (with link to the FormsCentral form) and  my email client supports using a different "from" address then I am good to go.    The alternative I was thinking about was changing my user credential/email address  for this one project so this different email address was used…. But this comes with some consequences I am not sure I want to manage.
    Doug

  • Can i send to multiple email addresses for the same contact

    I coach a baseball team and I want to create contacts under the kids' names with email addresses for both parents listed.  Can I send email to multiple email addresses listed inside the same contact?  I hope this makes sense.
    Thanks!

    You can do it individually, but it can also be done with Groups in Contacts, but you will need to create two or more groups. Once you have created the Groups in Contacts, drag the contacts that have multiple email addresses into each group. Then, select Edit Distribution List… from the Edit menu in Contacts.
    For each group, select one address or the other for each contact. Do the same for the other group.
    When you address an email, add both Groups to the address field in Mail.

  • Exchange 2007 Sending with Second Email Address (trying to use Send As)

    I support a company who just bought another company.  I'm trying to bring a couple of users' old email addresses in to Exchange and have it work with their old and new addresses.  They can receive mail under old and new accounts just fine.  Sending
    under the old address is the problem.  They still need to send under the old address for existing contracts.
    My first attempt was to create a distribution group, give it the user's old email address, and then give the user "send as" rights for the group using the Exchange Management Shell.  I ended up with the same error I'll detail below.
    My next (and current) attempt was to set up a shadow user in AD with the old email address and then give the user "send as" rights to the shadow mailbox.  I assigned the "send as" permission by right-clicking on the mailbox and choosing
    "Manage Send As Permission" and then adding the real user to the list.  In Outlook, I clicked From and then choose the shadow user account from the Global Address Book.  This added the address to the From drop down box.
    This works, once...  Every time I restart the Information Store service, I can get one email to send out successfully.  Here is the error I get on every other attempt.  Notice it says "send on behalf" in the error.  Maybe I'm not
    setting it up correctly in Outlook?  I didn't make Outlook screenshots but you'll find my AD and Exchange setup screenshots below.
    Thanks for the help.  
    (also posted at http://forums.msexchange.org/m_1800602162/mpage_1/key_/tm.htm#1800602162)
    ***ERROR START***
    Delivery has failed to these recipients or distribution lists:
    Tripp Beasley
    You are not allowed to send this message because you are trying to send on behalf of another sender without permission to do so. Please verify that you are sending on behalf of the correct sender, or ask your system administrator to help you get the required
    permission. 
    Diagnostic information for administrators:
    Generating server: 
    [email protected]
    #MSEXCH:MSExchangeIS:/DC=local/DC=XXXXXXXXXX:XXXXXXXXXX[578:0x000004DC:0x0000001D] #SMTP#
    ***ERROR END***

    open the list of previous recipients and select the ones you need by holding the command button. then press "add to address book".

  • Can you schedule a report to send to a email address that is pulled from a database field?

    Post Author: huber.molly
    CA Forum: Crystal Reports
    Currently, we are collecting email addresses in a database field. We want to send the generated reports to only these email addresses. Is there a way to add a dynamic value to the "To:" field when scheduling a report?
    The goal is to schedule the reports and let them be sent to these addresses so it removes the step of manually entering the addresses.

    Post Author: IdoMillet
    CA Forum: Crystal Reports
    It's not clear what tool you are using to schedule your reports.This may require a 3rd-party tool.  See list of such tools at: http://www.kenhamady.com/bookmarks.html. My Visual CUT software allows you to drag & drop an email field/formula from the report itself into the "Email To" option, to dynamically drive email options by the data in the report.  Alternatively, it allows you to use an SQL Query or a Text file to specify email addresses.- Ido

Maybe you are looking for

  • Hidden Text in PDF file generated from Ai

    One of my clients (an Ad Agency) has a problem with a PDF file. They make the layout in Adobe Illustrator them (to send the file to the newspaper) use the "Save as" menu and use the prepress setting. The designer use "Helvetica Neue" the TrueType tha

  • 8.1.7.3 to 9i

    What are the version and patch sequence from 8.1.7.3 to 9i ? Is 8.1.7.3 + patches renamed to 9i ? Can somebody clarify. Thanks.

  • Downloaded vs. 9.1 and now can't open any PDF files

    Can you open PDF files created on older versions of Adobe if you are running 9.1?  I didn't have any problems with 9.0 so should I delete the new version and reinstall 9.0?  Thanks

  • Function or bapi to upload the lead questionnaire to lead partner portal

    hi all, Is there any function or bapi to upload the lead questionnaire that exists in the marketing leads-lead partner portal . The survey should get attached to the lead . I am able to create the lead though with the LDPO process by a function modul

  • Can't save in CS5

    Hi all, When I open Cs 4 InDesign documents in CS5, I am not able to save and also the Undo option is disabled. Any ideas?