Sending E-Mail to all entries in a report.

Hello,
I am looking for a way to send an e-mail to all staff stored in a report based on whether they have completed their time sheet for this week or not. The e-mail will be sent to only those people that have not submitted the time sheet as a reminder.
Any help would be appreciated, thank you.

Hi,
DECLARE
    v_From      VARCHAR2(80) := 'Your.Worst.Nightmare;  
    v_Subject   VARCHAR2(80) := 'Time sheet due';
    v_Mail_Host VARCHAR2(30) := 'smtp.MAILHOST.com';
    v_Mail_Conn utl_smtp.Connection;
    crlf        VARCHAR2(2)  := chr(13)||chr(10);
    -- Read emails from table
    cursor emails is select email from tbl_emp where timesheet = "N";       
BEGIN  
    -- Sends the email to all listed
    for email in emails loop
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, email.email);  
    utl_smtp.Data(v_Mail_Conn,
       'Date: '   || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
       'From: '   || v_From || crlf ||
       'Subject: '|| v_Subject || crlf ||
       'To: '     || email.email || crlf ||
       crlf ||
       'Hi,
Submit your time sheet noob.'|| crlf ||     -- Message body       
KR,
Joe Bloggs,
UT2004 & QuakeLive player');
     utl_smtp.Quit(v_mail_conn);
     end loop;
EXCEPTION
     WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
        raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;
/Alter your query so that it lists those who didn't submit their timesheets & whatever message you want appearing. You need their email storing somewhere.
You put this PL/SQL into a PL/SQL region and give it a conditional display e.g. clicking a "timesheet overdue" button.
Mike

Similar Messages

  • Send e-mail to all my contacts

    Hello, how can i tell mail to include ALL my contacts to the destination field? Or in other words, how can i send a message to all my contacts. thank you.

    René Bijloo wrote:
    Sorry, my fault, i am translating from the spanish version. I meant passing the mail contacts from the mail app to the address bokk app. i have very few contacts in the address book. but thousands of addresses in mail.app. do i have to copy one by one to the address book?
    ok, got you. you really should keep your address book up to date. that makes it much easier to manage your email.
    in Mail go to window menu->previous recipients list. you can select some or all of those contacts and click 'add to address book". note that if you select everything this will add all emails you ever sent email to to the address book.
    but if there are some emails in the inbox that you never sent an email to those need to be added to address book one by one.
    also, since you mentioned thousands of emails, note what I said in my first email. I'm pretty sure that no email provider in the world will allow you to send an email to thousands of recipients at once.

  • Working in ECC 5.0..After approve, i need to send confirmation mail to all

    Hi,
    I am working in ECC 5.0...This is my requirement..
    After receiving the workitem approval message in managers inbox..after he approves/rejects,whatever approval i need to send back confirmation mail to Employee as well as payroll and admistrator and also two managers.
    Could u pls... how can i proceed with this scenario..
    Thanks and Have a nice day!!!
    Soni

    Hi Soni,
    We have handled a similar requirement in our project  , by writing a Custom function module for sending mails to Initiator, Payroll and managers approving the form.
    Actually we had created a custom function module for sending a mail.
    And this was called in one of the Method of the Business Object. (e.g: SENDMAIL - ZBUS7051 )
    and a background Step was defined in the Workflow template, which uses a task defined using the BOR Object - ZBUS7051 - SENDMAIL.
    Hope this helps.
    Regards,
    Raj

  • How to send a mail to Lotus Notes R5 from Report Builder 3.0.5.8.0 ?

    Dear sir,
    I try to send a mail via Report Builder, and I got the following error message:
    REP-4201:Error occured while initialzing the mail subsystem.
    REP-4202:There is the problem with
    the mail System.
    We use the Lotus Notes R5 mail, not Microsoft Outlook or exchange. Could the Report Builder support it?
    Thanks.
    Lisa

    Hi!
    1. Make sure no one else has opened the same file.
    2. Dont put image on your report.
    later
    Mircea Paciu (guest) wrote:
    : In Report builder 3.0.5.8.0 I can't open some of my *.rdf
    files.
    : When trying to open no error message is generated and the "open
    : dialog" reappears.
    : Some other files can be normally open.
    : Does anyone know how to solve this?
    null

  • I am having issues sending outgoing mail. All my settings are correct.

    I am unable to send outgoing messages with a specific email account.  I have checked my settings with both my provider (Cablevision/Optimum) and with Apple's online check system. All are the same as I am using. Any ideas?

    BTW, Optimum does not support secure email (TLS, or Transport Level Security). That means that if you check email using a public WiFi network (such as optimumwifi) anyone sharing that hotspot can capture your user ID and password. So you should never allow the phone to check email at a public WiFi location (e.g., Starbucks).

  • My contacts are accessed by someone and sending e.mails to all of my contacts can you help

    People in my contacts are constantly been bombarded with e.mails from me which I have never sent.

    It may be rather late now, but change passwords on email accounts, and scan for any malware in case there is for instance any keylogger present (& change passwords again if anything is found). Typical suggestions re malware are in this post: [/questions/757994#answer-204042]
    If the info ie your address book is already held by someone/something there is not much you can now do. Are the emails actually being sent from your account indicating someone has control over it, or is someone merely spoofing your account.
    You would probably get a more relevant information on a site related to your email account, or one dealing specifically with security / malware.

  • Sending Mail to all E-Mail Accounts for a Contact

    Hi all,
    When I'm sending mail to someone in Address Book, is there a way I can send the mail to all of their email accounts?
    Thanks

    The only "simple" way to achieve this is to create a new card for each email that contact has, then add them to a group, then when you send an email, select that group and the email will be sent to each of the email addresses of your contact.
    hope this helps

  • TS3276 Cannot send e-mail ,all parameters OK?

    Anyone have the same problem? Cannot send e-mail, but all e-mail settings appear OK.

    Check thru here:
    http://support.apple.com/kb/TS3276
    Some times deleting and recreating the account can help this, Mail preferences/accounts, write down all the info ina all fields, and all tabs.
    Delete the account from the left column highlight the acct and click the minus symbol at the bottom, reboot, then open Mail preferences accts, click the plus symbol and recreate the acct.
    If no joy call your provider, maybe they may have changed some of the settings that you need.

  • 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).

  • Sending e-mail over 3G doesn't work

    I can send e-mail from all accounts OK on wi-fi,however when on 3G only g-mail account will send.I am with Vodafone and have plus net e-mail account. Can anyone help. ( i-phone 4) Thanks

    It seems that your provider (Plus Net right?) is blocking outgoing emails not coming from their own connections. When you are on wifi, you are on plus net, but when on 3G, you are on Vodafone, and therefore the emails are blocked. This is what it looks like at least with the info given.

  • Exchange 2010 - Method to send e-mail when the WAN IP is dynamic

    Hello,
    I am writing due to the fact that I cannot send e-mail from my Exchange 2010 Server to my Yahoo! address for testing. When trying to do so, I get the following error message:
    mta1106.mail.gq1.yahoo.com gave this error:
    Mail from xxx.xxx.xxx.xxx not allowed - 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL; see
    http://postmaster.yahoo.com/errors/550-bl21.html [550]
    As one can see, because my IP address is residential, I cannot send e-mail to all addresses on the web. I really would like to use this as my primary contact, and thought of using a proxy. Can someone recommend a good proxy, or workaround for this? I am
    sorry for posting in Exchange 2013, but I couldn't find the 2010 forum. Thank you to all who reply.
    Mike

    Thank you for your reply,
    I have set up DynDNS, and I am currently using my own domain name. The problem was I needed to configure a smart SMTP host, or relay server on my send connector. I decided to go with SMTP2GO, as they are cheap, and allow you to send 20 e-mails a day for
    free. When the money is right, I plan to upgrade.
    Thank you for your help.
    Mike

  • Sending E-mail in Marketing Campaign

    Hi
    We have a requirement where we need to send E-mails to all 'Employee responsible' of customers in Campaigns.
    However at present system is having a field called 'E-mail address' field which will get the e-mail address from SPRO
    like below..
    SAP Implementation Guide > Customer Relationship Management > Marketing > Marketing Planning and Campaign Management > Personalized Mail > Maintain Sender Addresses for E-Mail
    Functional consultant will maintain an E-mail address(only one) here.However now the requirment is I should write a code such way that it should neglect this E-mail id and instead of this it should send the mail to all the 'Employee responsible' of customers in that Campaign.
    So could you please let me know the place (class or BADI of Function Module) in the SAP code where it stores the above said mail id so that I can modify the internal table with the required E-mail id's by replacing existing email id.(I'll try to use Enhancement spots...)
    Best Regards
    Anil

    Hi,
    You can send out email for marketing campaign in many ways.
    1.get the target group created using the BI infocube
    2.get the target group created using infoset query
    3.Import the business partner data directly from an external file (flat file).
    I will suggest an easy way of doing it.
    Login using Marketing professional Roles>workcenter>Marketing>Campaign>Create New campaign-->Create segment
    >create profile set>create profile-->create target group
    Note : when u create a campaign there will be a place where you can give the mailform name where the already created mail form name shuld be mainteined over ther, and the sender address too.
    click the target group created and click on the option import business partner.
    (pre req:the target email ids should be maintained as business partners in ur system whre you can maintain BPs email-id in the BP Transaction)
    get the list of business partner ids downloaded in the flat file from BP table.
    Import the list>start or schedule the camapign>you can run ur campaign for all the BPs .
    or manually enter the BP ids in the target group where the email address maintained for those BPs will be the target ids for your campaign.
    give a try.Let me know if you have any queries.
    Regards
    Jgds

  • Cannot send Internet Mail with Netscape Messenger 4.2 on Windows 2000 Server

    I can send internal mail with all my users and receive external mail, but when I try to reply or send to an external address, they just get SMTP Deffered and never get sent. What am I doing wrong?

    Netscape Messaging Server 4.15 is not supported on Windows 2000. Only on Windows NT.
    Sorry.

  • Sending e-mail to more than the person resp. when budget almost exceeded

    Hi,
    The configuration has been done for sending a warning e-mail to the person responsible using transaction (OPS6). However, the requirement is to send this e-mail to some other employees in addition to the person responsible. Could anyone explain to me how to implement such requirements, either at configuration level or using ABAP?
    Best regards,

    May be you can create an group e-mail ID (distribution list) and assign this to person responsible. This would send e-mail to all the people grouped in this mail ID.
    I never tried but seems plausible.
    Regards
    Sreenivas

  • Sending e-mail periodically

    Hi everyone, i'm new in sql so please give the solutions basically. Is there any way that i can send my table with e-mail in every 1hour?

    DECLARE
    v_From VARCHAR2(80) := '[email protected]';
    v_Recipient VARCHAR2(80) := '[email protected]';
    v_Subject VARCHAR2(80) := 'test subject';
    v_Mail_Host VARCHAR2(30) := 'mail.ere.com.tr';
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    BEGIN
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    utl_smtp.Data(v_Mail_Conn,
    'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf ||
    crlf ||
    'some message text'|| crlf ||     -- Message body
    'more message text'|| crlf
    utl_smtp.Quit(v_mail_conn);
    EXCEPTION
    WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
    raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;
    this gives me error which is "17:07:16 ORA-20000: Unable to send mail: ORA-29279: SMTP permanent error: 554 5.7.1 <[email protected]>: Relay access denied"
    what can be the problem. I have a smtp account but never used in and don't know what to do with my username and password. The codes in internet to send e-mail are all junk. Can anyone give me the code that i want?
    Edited by: 790798 on 26.Ağu.2010 07:11

Maybe you are looking for

  • How to add a row in an emty table

    Hi, I would like to use only one nav bar in a Panel containing 2 JTables. So I bind the nav bar to the JUPanel. The problem is if one or both of the tables are empty there is no way to add a row, since the JTable doesn't get the focus and the nav bar

  • I can't get it to download

    I purchased Lion from the app store and I can't get it to download.

  • IPod touch and AV cable

    If I connect my iPod to a TV through AV cable (from Apple or other provider, connected to 30-pin socket), will the iPod's screen while watching a movie turn off to save battery?

  • HELP I DOWNLOAD A SONG AND IT WONT PLAY

    im using windows vista an the new itunes and i cant seem to get my songs to play im paying for music and it wont play please help

  • Viewing Rates assigned to a Project from cProjects

    Hi Gurus I have created a project in cProjects and released, etc. Is it possible to use a SAP PS Transaction to view the Rates assigned to each Task. I have tried using CJ20N but I have haven't been able to locate what I'm looking for. Any guidance o