Need to send email to email addresses in one list when list 2 is updated

I have  2 lists
list 1 has email addresses
the 2nd list is actually a document library
what I was wondering, is how can I send an email to people to people in list 1 when list #2 is updated with new documents?
i have been trying different  ways of doing it, but no luck....
anyone have any ideas how to capture the email address from list 1 and send them an email when list #2 is updated?
seems straight forward but cant find the logic...

Hi,
I would suggest you to go for custom event receiver using visual studio. Its an easy way.... try it out.
Choose List item event in event receiver settings.
Step 1:Add item was added and item was updated event. Use caml query to fetch email address and loop through the collection and send email using SPUtility. Refer below code.
/// <summary>
/// An item was added.
/// </summary>
public override void ItemAdded(SPItemEventProperties properties)
//base.ItemAdded(properties);
using (SPWeb web = properties.OpenWeb())
SPQuery query = new SPQuery();
query.Query = "<OrderBy><FieldRef Name='Title' Ascending='False' /></OrderBy>";
SPList emailList = web.Lists["List1"];//The list which has the email addresses
SPListItemCollection listItemCollection = emailList.GetItems(query);
foreach (SPListItem item in listItemCollection)
SPUtility.SendEmail(web, true, false, item["emailAddress"].ToString(), "Your Mail subject", "Your mail body");
/// <summary>
/// An item was updated.
/// </summary>
public override void ItemUpdated(SPItemEventProperties properties)
//base.ItemUpdated(properties);
//you can provide same code here..if needed.
Step 2: Provide the list2(document library) path as the ListUrl in Element.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListUrl="/list2/"> <!--provide document library path...-->
<Receiver>
<Name>EventReceiver1ItemAdded</Name>
<Type>ItemAdded</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>SharePointProject1.EventReceiver1.EventReceiver1</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
<Receiver>
<Name>EventReceiver1ItemUpdated</Name>
<Type>ItemUpdated</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>SharePointProject1.EventReceiver1.EventReceiver1</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
Deploy it to your SharePoint farm..make sure the feature is activated..and enjoy..
Probably this should work..Check it out and let me know..
Regards,
Dinesh

Similar Messages

  • How do I copy and paste email addresses from one email to a new one?

    I need to copy email addresses from one email to a new one. I can copy, but I can't paste them to the new email. Any help would be appreciated!

    Highlight it and then right click, select Copy. then go to the new email you are writing and place the cursor in the TO field and right click, select Paste.

  • Webservice needs sender email address to be that of service user -how todo?

    I host a web service. It is used by merchants in their web sites. My web service sends notifications to the merchants customers. Trouble is the sender email address is my web service email address and not that of the merchant. Some merchants do not like this and they want emails to their customers to be seen to come from them.
    What would I (or the merchant) need to do in order to be able to set the sender email address to that of the merchant. Im assuming I can't just go ahead and set the sender to be any old email address! e.g. Im thinking Id have to use the merchants smtp host or something.

    You can set the sender to whatever you want; that's why there's spam.
    Whether your SMTP server will allow you to send with any arbitrary sender is a different story.
    If you run your own SMTP server, you can control this. Otherwise, yes, you would probably need
    to use the merchant's SMTP server and login credentials.

  • TS2755 I have just updated my phone to iso 7 on my wifes i tunes on her computer, now when i send a message to people they get my email address come up and when i need to update it askes for her apple id.. any help please

    I have just updated my iphone to iso 7.0.2 on my wifes i tunes on her computer,now when i send a message to people they get my email address come up and when i need to update apps it asks for her apple id... any help please????

    ChrisJ4203,
    Thank you for the help.  Every app on my phone was downloaded using my old I-tunes ID.  I just hope that they will re-download under my new ID because I still can't change it on my phone.  In order to change to the new ID it says I have to sign out from the old ID and change to the new one.  My problem is that I don't remember my password to be able to sign out from my old ID.  Then the phone says it can change my password through e-mail and I  agree but I never get an e-mail at my old address or the new one.
    BHuyett

  • Are socket needed to send emails?????

    hi guys,
    lets say i need to send an email notification everytime i finish doing a cetain task....do i need to create and use a socket to send these emails????
    thanks in advance for any help...
    lost and blur.
    Below are the codes to send email:
    (So are socket needed???)
    public void execute(String mailto, String mailcc, String mailsub, String mailbody){
    //session object inside the catch block also(in case of DCOException).
    DCOSession ds = null;
    try{
    ds = new DCOSession(); // Create new DCOSession object
    ds.login("erstest02"); // Log in as current Notes client user
    DCOMail dm = new DCOMail(); // Create new DCOMail object
    dm.setDcoSession(ds);// Pass DCOSession to mail
    //dm.setDebug(true);
    dm.setSendTo(mailto);
    dm.setCopyTo(mailcc);
    //dm.setBlindCopyTo();
    dm.setSubject(mailsub);
    dm.setBody(mailbody);
    //System.out.println("before mail sent");
    dm.send(); // Send the mail
    ds.logout(); // Log out of the session
    System.out.println("mail sent to "+mailto);
    }catch(DCOException e1){
    e1.printStackTrace();
    try{
    if(ds!=null){
    ds.logout(); //Log out of session even if exception is thrown
    }catch(Exception ee1){
    System.out.println("Exception thrown while trying to logout of session");
    ee1.printStackTrace();
    }catch(Exception e){
    e.printStackTrace();
    try{
    if(ds!=null){
    ds.logout(); //Log out of session even if exception is thrown
    }catch(Exception ee2){
    System.out.println("Exception thrown while trying to logout of session");
    ee2.printStackTrace();
    }

    lets say i need to send an email notification
    everytime i finish doing a cetain task....do i need
    to create and use a socket to send these emails????Yes, sockets are needed to send emails. However, you don't need to deal with them yourself. You can use the JavaMail API. It will hide those low level details from you and let you deal with concepts that are related to sending emails--addresses, contents, servers, etc.
    http://java.sun.com/developer/onlineTraining/JavaMail/

  • N95 Need Nokia Feedback Email Address

    N95 Need Nokia Feedback Email Address
    I am amazed to be told in these forums Nokia dont even read these forums at all, they could learn alot
    from people who have actualy shelled out loads of money for there favourite Nokia.
    So now I need an Email Address for Nokia N95 Feedback so I can send my bug reports.thanks.
    N95-1 (8GB-MicroSD),LCG-Audio,Fring,Nimbuzz,Skype,Youtube,iPlayer,Garmin4-GPS.Googlemaps,SkyFire,ZoneTag,Gravity, Sennheiser CX-400-IIs,500-IIs,TR-120 Wireless,HD215'S.AudioTechnica ATX-M50's.BT B-Tube BT Speaker.

    There isn't really one address to send Nokia feedback.
    However you can find Nokia's contact details here :
    http://www.nokia.com/A4126575
    Regards,
    Edward

  • Change sender email address for payment advice

    Hi,
    I used FIBF to activate BTE 2040 to allow me email Payment Advice. This is working well and takes the 'Sender' email address from the user master data. I don't want to use the user master data so does anyone know how/where to change the sender email in the code?
    I have copied SAMPLE_PROCESS_00002040 and can implement 2050 if needed but that seems to only modify the text of the mail - not the sender email?
    Thanks.

    accounting Clerks need to be setup

  • Need to send email with content of total sales

    Hi experts,
    I have configure notification mailer and have received also test email. Usually I may receive oracle alerts in my email address.
    I need two solutions or need to build below mention point.
    1) need to send email total daily sale ?
    2) need to setup oracle alerts ?
    I am waiting your kind response or refer solid documents to fulfil my requirements
    Thanks

    You can configure an alert that fires every day at about 1:00 am.
    The alert can query oe_order_lines_all table for all orders lines that were created in booked status on the prior day.
    Then you can format the alert to include the total amount.
    You can group by sales person or by warehouse.
    If you want to group the sales by item numbers, the email may become long depending on the number of items you sell every day.
    See http://docs.oracle.com/cd/A60725_05/html/comnls/us/alr/summary.htm for a great example on how to send a summary alert.
    Hope this helps,
    Sandeep Gandhi

  • BI Ibots sender email address

    hi,
    does anyone know how to set up BI to send out different ibots with different sender email address? currently it is global. From the EM Core application --> Deployment --> Mail then on the top you set the 'mail address of the sender'. That turns out to be the global sender email address for all the ibots. however, i have a requirement where i need to send ibot reports to show the sender as a different address for different ibots along with the recipient.
    Thanks in advance for any inputs.
    Shamol

    Thanks SriniVEERAVALLI,
    I tried to create a profile in the WLS and granted admin right; after that i tried to run an ibot 'Run as' that profile, however, after trying that it still shows up with the global sender email address as a sender.
    Did you mean something different?
    Thanks again,

  • Sender email address name - add name

    Hi All,
    I am in CRM 5.0 CIC0 email editor and would like to change the sender email address - for display in recipient's mailbox not as recived from myCRM(at)app.com but rather to display as received from 'My CRM Company myCRM(at)app.com'.
    I found BAdi IF_EX_CRM_MAIL_HANDLING~PREPARE_VISIBLE_NAME_FOR_ADDR, but have now idea how to prepare the address value. When I enter there 'My CRM Company myCRM(at)app.com' it throws me "Unknown error".
    Can you help?
    Regards

    in the badi we need to write name and later email address in <> signs. then it will work

  • Why does my email address get messed up when people hit reply sending from Mac Mail 4.6

    Why does my email address get messed up when people hit reply sending from Mac Mail 4.6
    OSX 10.6.8

    I talked to our email provider and they say it has to do with the way thre recipients email address book has recorded the address. They say that they need to fix the address on their end.

  • HT3529 I have just bought an iPad I have typed in email addresses into Contacts, but when I try to send a message most of them come up within red with an !. Then it will not let me send! This is sapping my confidence ! Please help if possible!

    I have typed in email addresses into Contacts, but when I try to do an email, most of them have an exclamation mark and won't let me send! Where am I going wrong ? It is really sapping my confidence!

    Did you set up your email account info in Settings?
    Settings > Mail, Contacts, Calendar > Accounts > your account should be listed in there with the appropriate incoming and outgoing mail servers and correct user names and passwords.

  • Sender email address verification

    During my recent DNS server outage (caused by XO DSL suddenly turning on filtering of port 53), I noticed something quite interesting with .Mac server and I am wondering if there is a way for Tiger server users to EASILY implement the same feature to reduce the inflow of spam?
    When my DNS stopped, my .Mac account STOPPED accepting email from my work account, essentially saying there was no such account on my work server.
    I obviously do understand that the fact that my DNS was not working and my server could not be verified was the reason for this, but it got me thinking....
    Is there any easy way to put this sort of incoming email verification process on my OWN Tiger server (work)? i.e. Only accept delivery of incoming email AFTER you verify that the sender email address DOES correspond to a valid email account on the senders host?? - which means no bogus email address or hostnames accepted...
    I think this would help cut down on a lot of Spam as these guys often send junkmail via bogus accounts/host names that cannot be replied to.
    Any useful information regarding setting this up would be most appreciated
    Thanks in advance - Rohin

    My question is ... wouldn't it make sense to check whether sender emails are valid before accepting email server connections.
    There's not really any way of doing that, besides, that's not really what you want.
    What you want is to ensure that the email comes from the person that it says it comes from. What you'd get is that the email says it comes from a valid email address. This is not the same thing.
    Even now, 99% of spam emails are sent from valid email addresses - it's trivial to put any email address in the 'from' header.
    Knowing that the From address is valid doesn't actually do anything to say that the person in the From header is the one who actually sent the message in the first place.
    There are several industry-wide attempts and performing validation at the domain level, which is about as good as it's going to get in the near term. For more information check out Sender Policy Framework which defines (via DNS) which IP addresses are permitted to send email for a particular domain, and DomainKeys which uses digital signatures to validate the email.
    Since both models require input from the domain owners, they won't be 100% reliable until all domains opt-in to the schemes. For now it can help validate that an email is from a legitimate domain, but the absence of a SPF or DomainKey doesn't necessarily mean the message is spam.
    The only way to verify that the email comes from a valid user is some kind of confirmation - an email comes into your mail system which doesn't recognize the sender, so it holds the mail and sends a message back to the sender saying 'who are you?" and "if this message is legitimate, follow this link to unblock the message". The message is forwarded only after the sender confirms their identity and that the message is legitimate.
    This has all kinds of issues, though including latency (it takes longer for messages to get to you), delays (what if the sender sends the message right before they leave on a week's vacation?), and not least the complete lack of support for any kind of automated messages, list, etc. that are sent from non-humans.

  • Workflow step - send email - address of sender

    Hi,
    We are using workflow to register travels and leave requests and we are sending emails to the employees about eg. that their document has been rejected/approved. Emails are sent by user WFBATCH. Is it possible to change this user to some other one so that we could change the sender email address?
    Thank you!

    Hello,
    If you're usng a SendMail step then (if I remember correctly) it's always run in background and therefore always WF-BATCH.
    Usually, if I want to do anything unusual with mails from workflow then I create a step which calls a task which calls a new method of my BOR object which calls fm SO_NEW_DOCUMENT_ATT_SEND_API1. See if you can specify the sender there.
    Please let the forum know how you get on.
    regards
    Rick Bakker
    Hanabi Technology

  • Hotmail - Sender email address is invalid

    Hi,
    Ever since I got my new iPhone 3GS, I have not been able to send emails. I had an izymail subscription for hotmail on my original iPhone and it worked fine. I synced everything over to my new iPhone 3GS and also made a new email account as Hotmail is now free to set up using POP3.
    I turned my izymail account off because I was having problems with it fetching old deleted emails once or twice a week. Everything was working as normal until I tried to send an email and the following message appeared: "Sender email address is invalid"
    I've tried switching my izymail account back on and switching my new Hotmail POP3 account off and my emails will send ok...
    So why are my emails not sending with my newly setup Hotmail POP3 account?

    Sender Address invalid is the error message you get when your SMTP (outgoing email) settings are not working.
    Many times this is because you are trying to use an SMTP server on a WiFi network and the ISP is blocking all SMTP connections that are not going to the ISP servers - this is to stop spammers.
    Also, you will get this message when you try to use your SMTP server on 3G or Edge - the ISP sees a connection to their email server (SMTP) coming from AT&T (or your cell carrier) network not their own network and they think it is spammer so they deny the connection.
    Some things to try - turn on the default SMTP server on the ipHone that corresponds to your carrier - when on 3G/Edge you can use this outgoing email server to connect without problems. Or, look to see if your ISP offers an email server on a different port (mine offers one on port 80 - all web browsers use this so other nets can't block it). Look for settings for authenticated SMTP servers - if your mail provider offers this it may be a way in also.
    The search box (top right) will bring you many threads on this same subject.

Maybe you are looking for

  • Problems installing Oracle 9i Database on Windows XP Pro

    Please Help!!!!!!!!! When trying to install the Personal Edition Database, the installer never asks for the additional disk to be inserted and, after running for a while the Universal Installer disappears with no error window, therefore not completin

  • Can I run both legacy Java and the latest version on my Macbook

    My CS4 Indesign now says I need the legacy Java version to run it. I upgraded to Yosemite and use CC 2014 Photoshop, but don't want to upgrade my Indesign as I don't use it much, but I do want it available. Can I run two versions of Java on the same

  • "resource not loaded" message

    Hello! I´ve a library that was implemented on LabView 5.1 and it worked fine. Then, one day, i tried to open this library using LabView 7, and it worked as well, but now, whenever i try to open the program using LabView 5.1 it pops up a "resource not

  • Large amounts of video data 2TB+

    Over the next several months the University of Michigan will be videotaping elementary school classes. We hope to tape at least 40 classrooms with two cameras in each classroom for about 90min each. Im estimating I will have 2-3 TB of video files I n

  • Unable to connect to NWA and Visual administrator

    HI all - I have Java stack installed i at its own database which coexists with another ABAP stack on same virtual machine. I am not able to connect to Visual administrator to install the saplicens. connection error is as follow Unable to connect to h


HashFlare