Reading email in outlook with c# and parsing the body

Hello,
I don't know where to start.
The organization I work for uses different user web forms to collect user/client feedback. Instead of having those forms populate a table, they have them emailed to me as text in the body of an email for me to decide what to do with. My (local) boss wants
me to upload the data into our CRM. Everyone expects me to do that by hand ( which is now getting out of hand :D.)
I need to read an outlook 2010 email in a shared mailbox (to which I do not know the account password for mail server access) and parse the body data into a data table. 
If I can get some help understanding how to access the individual email file(s) and read the data into a string array or something that achieves this result, I can take it from there.  All suggestions are welcome however going back to the admin who
is in another country, won't make changes and doesn't speak english are not paths I can follow.
My glass here, is half full with the opportunity to resolve this challenge. 

Hello,
You can develop a VBA macro for handling new emails in the shared mailbox. I'd suggest starting from the
Getting Started with VBA in Outlook 2010 article. If you see a shared mailbox in your Outlook profile you can subscribe to the Inbox events (for example, ItemAdd) in the following way:
Dim WithEvents myInboxMailItem As Outlook.Items
Private Sub myInboxMailItem_ItemAdd(ByVal Item As Object)
Call MsgBox("Item Added", vbOKOnly, "[email protected]")
End Sub
Private Sub Initialize_Handler()
Dim fldInbox As Outlook.MAPIFolder
Dim gnspNameSpace As Outlook.NameSpace
Set gnspNameSpace = Outlook.GetNamespace("MAPI") 'Outlook Object
Set fldInbox = gnspNameSpace.Folders("[email protected]").Folders("Inbox")
Set myInboxMailItem = fldInbox.Items
End Sub
Private Sub Application_Startup()
Call Initialize_Handler
End Sub
In the ItemAdd event handler you can get all the required information parse the message body. The Outlook object model provides
 three main ways for working with item bodies: Body, HTMLBody and WordEditor.

Similar Messages

  • Calling web service with utl_dbws and parsing the xml result with Xpath

    I'm invoking a web service from the database(10.2.0.2.0) using sys.utl_dbws and all is working well. After executing response := sys.utl_dbws.invoke(call_, request); I execute dbms_output.put_line(substr(response.getstringval(),1,1500)); which results with:
    <refCursor10gProcessResponse xmlns="http://xmlns.oracle.com/refCursor10g">
    <result xmlns="http://xmlns.oracle.com/refCursor10g">
    <Row xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/ADM/SERVICES/GETST/">
    <Column name="C_ID" sqltype="VARCHAR2">20292</Column>
    <Column name="AYR" sqltype="VARCHAR2">2002</Column>
    <Column name="EDT" sqltype="VARCHAR2">2002-06-13</Column>
    <Column name="ETUS" sqltype="VARCHAR2">O</Column>
    <Column name="PC" sqltype="NUMBER">537</Column>
    <Column name="SG" sqltype="VARCHAR2"/>
    <Column name="VD" sqltype="VARCHAR2">Y</Column>
    <Column name="VR" sqltype="VARCHAR2">R</Column>
    <Column name="TS" sqltype="VARCHAR2">31</Column>
    <Column name="D" sqltype="VARCHAR2">I</Column>
    <Column name="T" sqltype="VARCHAR2">1</Column>
    <Column name="P" sqltype="VARCHAR2"/>
    <Column name="MT" sqltype="VARCHAR2">2</Column>
    <Column name="PTAT" sqltype="VARCHAR2"/>
    </Row>
    </result>
    </refCursor10gProcessResponse>
    How do I parse out just the value 20292 of Column name="C_ID" using xpath? I've tired but I don't think i have the xpath set up correctly:
    dbms_output.put_line(response.extract('//result/Row/Column/child::text)','xmlns="http://xmlns.oracle.com/refCursor10g"').getstringval());
    Error messgae is:
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at "ADM.CONSUME_WEB_SERVICES", line 439
    ORA-06512: at 3
    Thanks

    Tried getting by the attribute but I don't think I have the format correct:
    dbms_output.put_line(response.extract('//result/Row/Column@C_ID/child::text()','xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/ADM/SERVICES/GETST"').getstringval());
    Here's the full soap response envelope:
    <env:Envelope
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <refCursor10gProcessResponse xmlns="http://xmlns.oracle.com/refCursor10g">
    <result xmlns="http://xmlns.oracle.com/refCursor10g">
    <Row xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/ADM/SERVICES/GETST/">
    <Column name="C_ID" sqltype="VARCHAR2">20292</Column>
    <Column name="AYR" sqltype="VARCHAR2">2002</Column>
    <Column name="EDT" sqltype="VARCHAR2">2002-06-13</Column>
    <Column name="ETUS" sqltype="VARCHAR2">O</Column>
    <Column name="PC" sqltype="NUMBER">537</Column>
    <Column name="SG" sqltype="VARCHAR2"/>
    <Column name="VD" sqltype="VARCHAR2">Y</Column>
    <Column name="VR" sqltype="VARCHAR2">R</Column>
    <Column name="TS" sqltype="VARCHAR2">31</Column>
    <Column name="D" sqltype="VARCHAR2">I</Column>
    <Column name="T" sqltype="VARCHAR2">1</Column>
    <Column name="P" sqltype="VARCHAR2"/>
    <Column name="MT" sqltype="VARCHAR2">2</Column>
    <Column name="PTAT" sqltype="VARCHAR2"/>
    </Row>
    </result>
    </refCursor10gProcessResponse>
    </env:Body>
    </env:Envelope>
    Any thoughts?

  • Read email from microsoft exchangeserver 2010 and save attachement

    Hello,
    I want to read email from microsoft exchangeserver 2010 and save attachement into a folder.I created an Java program to import attachments from a exchange server mailbox using "POP3S".It works fine when run as a java application.But when i put this inside Oracle11g R2 using load java and while executing from a procedure it gives an error at parsing message into Multipart
    Error at line : Multipart mp = (Multipart)m.getContent();
    Error:
    Content-Type: multipart/mixed;
    boundary="_002_A0C2E09A..................................."
    java.lang.ClassCastException
    at mailPop3.checkmail(mailPop3:71)
    My Java Class is as follows,
    import java.io.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.Date;
    The function i used to check for attachments is given below.
    public static boolean hasAttachments(Message m) throws java.io.IOException, MessagingException
    Boolean hasAttachments = false;
    try
    // if it is a plain/html text - no attachements
    if (m.isMimeType("text/*"))
    return hasAttachments;
    else if (m.isMimeType("multipart/alternative"))
    return hasAttachments;
    else if (m.isMimeType("multipart/*"))
    Multipart mp = (Multipart)m.getContent();
    if (mp.getCount() > 1)
    hasAttachments = true;
    return hasAttachments;
    catch (Exception e) {
    e.printStackTrace();
    } finally {
    return hasAttachments;
    My Java Details as follows
    java Version :1.5.0_10
    java.vm.specification.version:1.0
    java.vm.version :1.5.0_01
    java.specification.version:1.5
    java.class.version:48.0
    Java mail API:javamail-1.4.4
    Used Jars:mail.jar
    Could someone explain why I am getting this error? What can I do to resolve this error?
    Is any other Jar need other than mail.jar?
    Any help would be much appreciated.
    Regards,
    Nisanth

    889509 wrote:
    This java class has no error.Then it should work - not only at compile time, but at run-time too.
    Because it does not, it means there are errors. And as the error you've posted is not an Oracle SQL or PL/SQL error, your question is off-topic to this forum.
    Why would the code not work at run-time? Numerous reasons, including environmental ones. Java inside Oracle are subjected to a number of restrictions and limitations that do not exist in a Java VM outside Oracle (for good reasons).
    So you need to consider that too - and that is why I referred you to the documentation... which is IMO mandatory reading for all Oracle developers.

  • I entered my email in word with friends and it did not allow me to sign on. It said I needed to activate the email. How do I do that?

    I entered my email in word with friends and it did not allow me to sign on. It said I needed to activate the email. How do I do that?

    What does: "I entered my email in word with friends" mean?  Please explain better your problem and what you want to do.

  • Getting inner exception "dtd is prohibited in this xml document exchange" while reading emails from outlook

    Getting error "The response received from the service didn't contain valid XML." with inner exception "dtd is prohibited in this xml document exchange" while reading emails from outlook(Not while reading every mail).
    Can anybody please tell me what might be the issue. Below is the code where I am getting error
    FindItemsResults<Item> RetrievedItems=null ;
    RetrievedItems = service.FindItems(FIds, new ItemView(4));
    String[] SignatureList = ConfigurationManager.AppSettings.Get("SignatureTypes").Split(',');
    if (RetrievedItems != null && RetrievedItems.Count() > 0)
    RetrievedItems.ToList().ForEach(x =>
    try
    List<String> Attachments = new List<String>();
    List<String> ScanFileName = new List<String>();
    bool IsAvailable = true;
    //Getting error while Load() - below line of code
    ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Load();
    Vo.EmailMessage msg = new Vo.EmailMessage();
    msg.MessageId = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Id.UniqueId;
    msg.From = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).From.Address;
    ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).ToRecipients.ToList().ForEach(z => msg.To += z.Address + ",");
    ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).ReplyTo.ToList().ForEach(y => msg.ReplyToEmailAddress += y.Address + ",");
    msg.Subject = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Subject;
    msg.Body = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).Body.Text;
    msg.Dated = ((Microsoft.Exchange.WebServices.Data.EmailMessage)x).DateTimeSent;
    Please help.

    Hi,
    Thank you for your post.
    This is a quick note to let you know that we are performing research on this issue.
    Niko Cheng
    TechNet Community Support

  • HT5312 I forget answer to my qustion with rescue email adrees please help me and send the answer to my main mail. Thank you very much

    I forget answer to my qustion with rescue email adrees please help me and send the answer to my main mail. Thank you very much

    We are fellow users here on these forums, you're not talking to iTunes Support.
    If you don't have access to your rescue email account, or you don't have one on your iTunes account, then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset you can then use the steps half-way down this page to add/change a rescue email address for potential future use : http://support.apple.com/kb/HT5312

  • Is there a way I can right-click on an email address on a page and open the url associated with that email

    I'd like an easy way to right-click on an email address on a page and open the URL of that email. Ie ([email protected] and open up mozzilla.org in a new tab or window). Is there a way of doing this or an add-on that does it without having to highlight and cut and past into the address bar?

    You can't delete the address, but you can set up a Rule to move messages to that address to the Trash or another folder. Go to http://icloud.com and go to the Mail page, click the cogwheel icon at top right and choose 'Rules'.
    It's a bad idea to post your email address - it's an invitation to spam - even though in fact you haven't posted them in full; I've asked the hosts to remove them.

  • TS1389 I used to have another email address associated with Itunes and transfered my songs to my new Imac now some of the songs wont play because they were athorised on another computer and I cannot remember my old Itunes password associated with the old

    I used to have another email address associated with Itunes and transfered my songs to my new Imac now some of the songs wont play because they were athorised on another computer and I cannot remember my old Itunes password associated with the old email.

    Hello Johnny Reptile,
    The following article details the necessary steps for resetting your old Apple ID's password.
    Apple ID: Changing your password
    http://support.apple.com/kb/HT5624
    Cheers,
    Allen

  • When i send an email with greek characters in the body, the recipient receive it in an unreadable form.

    When i send an email with greek characters in the body, many recipients (not all) cannot read it.
    At the same time when i use the internet mail it can be read successfully by the recipient.
    I have already checked the encoding settings in the Fonts in order to be "unicode (UTF-8)".
    What else can i check?
    Thanks in advance.
    e.g:
    From: Eleni Kontomari [email address removed by moderator Andrew]
    Sent: Thursday, February 27, 2014 12:33 PM
    To: "Nikos Totsios (Ηλεκτρονική διεύθυνση)"; "Giannis Diokarantos (Ηλεκτρονική διεύθυνση)"; "Dimitris Papadopoulos (Ηλεκτρονική διεύθυνση)"; Vassilis Gounaris; "Vassos Efthymiadis (Ηλεκτρονική διεύθυνση)"; Νικηφόρος Κεκρίδης; Ιωάννης Αθανασόπουλος; "Alexis Katsivas (Ηλεκτρονική διεύθυνση)"; Μιχάλης Παπαοικονόμου; Fomesa Hellas; "Χρήστος Σπηλιάδης (Ηλεκτρονική διεύθυνση)"; Δημήτρης Μπενάκης; "Ν. Γαλάνης"; [email protected]; "Αποστόλης Σαμούδης (Ηλεκτρονική διεύθυνση)"; "Β. Ντουρτόγλου (Ηλεκτρονική διεύθυνση)"; [email protected]; [email protected]; "Φοίβη Λεγάκι (Ηλεκτρονική διεύθυνση)"; "Παναγιώτης Κουμεντάκος (Ηλεκτρονική διεύθυνση)"; Σπύρος Ζαφείρης; Hans- Joachim Henn; "Κώστας Αλεξανδρόπουλος (Ηλεκτρονική διεύθυνση)"; [email protected]; [email protected]
    Subject: ΠΡΟΣΚΛΗΣΗ ΤΑΚΤΙΚΗΣ ΓΕΝΙΚΗΣ ΣΥΝΕΛΕΥΣΗΣ ΕΣΥΦ
    ... 13 2014.
    ''Please read [[Forum rules and guidelines]] when posting a question in a public forum''

    There are some language add ons that support emails from other languages that you can check out: [https://addons.mozilla.org/en-us/thunderbird/extensions/language-support/?sort=popular]
    The recipient, if they also use thunderbird may need to have a language pack to read the email: [https://addons.mozilla.org/en-US/thunderbird/language-tools/]
    You may also need to have them check their interpreter to make sure the email is being received in the same format it is being sent.

  • How can I start anew with Photos and clear the (minimal) stuff it has uploaded

    I've about had it up to here with this new Photos scheme. I reorganised my Aperture libraries on both my iMac and MBA in preparation for this, delayed turning Photos on for a couple of days until I thought everything was ready based upon the limited advice that was out there, and then got stuck in an endless loop of "uploading" and "preparing" every time I opened Photos. There are 19,975 images in my Aperture library on the iMac. I was stuck at Uploading at anywhere between that number and 19,000 with no progress after hours of waiting. I tried all the tricks mentioned here including re booting, restarting the app, repairing/rebuilding the database, killing the "cloudd" process, etc.today Today when I restarted Photos, it now said I had 23,775 images to upload- 4000
    more than I have-and of course it got stuck there, like it has for the last week.
    I copied the previous Aperture library (pre Photos migration)back to my iMac and opened it in Aperture. Thankfully, all the photos I had taken on my iPhone this week during this Photos clusterphuck transition were in the Aperture Stream so I didn't lose any of those. I'm willing to give this whole thing one more shot. So  i need some advice. How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    <Re-Titled By Host>

    How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    It is hard to say from your post, why the migration did not succeed in your case.
    by "stuck on upload" do you mean, you opened the Aperture library in Photos, and Photos converted it to a Photo Library, and then the upload to iCloud Photo Library did hang?  Or did already the upgrade to the Photo Library fail?
    If you want the Aperture library to upload to iCloud Photo Library, it needs to be on a disk formatted MacOS Extended (Journaled) and the original image files must not be referenced. Referenced originals will not upload.
    Also, the upload may hang, if you do not have enough free iCloud storage, orr if one of the videos or photos in your library is in an unsupported format or corrupted.
    To start over, try to repair and rebuild the Aperture library before opening it in Photos. Try all Aperture Library First Aid options - starting with repairing the permissions.  (Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual)
    If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    You will have to delete the photos that are already in icloud too; otherwise you are risking duplicates.
    Can you launch Photos at all?  If yes, delete all photos in Photos and empty the Recently Deleted album. Wait for the deletion to sync to iCloud. Then delete the Photos.photolibrary.

  • I just switched from Outlook to Mail and now the sent messages are not being displayed.  Help, please.

    I just switched from Outlook to Mail and now the sent messages are not being displayed.  Help, please.

    Back up all data. Rebuild the mailbox.

  • Hi friends, I'm having troubles with my Ipad 2. I was working with it and suddenly the screen distorted. Now it is not possible to get it back to work properly. In fact, the screen is now black and nothing I have done makes the Ipad works again. Thanks

    Hi friends, I'm having troubles with my Ipad 2. I was working with it and suddenly the screen distorted. Now it is not possible to get it back to work properly. In fact, the screen is now black and nothing I have done makes the Ipad works again. Please Help. Thanks in advance.

    I think you should make an Genius Appointment.
    Genius Appointment
    http://www.apple.com/retail/geniusbar/

  • I cannot install adobe reader. I get so far and get the message "Error 1324. The oath All folders or the volume is invalid. Please enter it again" can you help?

    i cannot install adobe reader. I get so far and get the message "Error 1324. All folders or the volume is invalid. Please enter it again" can you help?

    We need to know if any registry settings are causing this error.  Please follow these instructions:
    from Windows Start | Search: type regedit and hit Enter; you will see a window like this
    now click on the little arrow ▹ left from HKEY_CURRENT_USER
    Next click the arrow ▹ beside Software, then Microsoft, then Windows, then CurrentVersion, then Explorer, then click on User Shell Folders
    all entries on the right side should start with %USERPROFILE%
    If you have anything different, this may be the cause for the install failure.
    Now you need to repeat the same thing for another key:
    ▹ HKEY_LOCAL_MACHINE ▹ Software ▹ Microsoft ▹ Windows ▹ CurrentVersion ▹ Explorer ▹ User Shell Folders
    Here all entries should start with %PUBLIC% or %ProgramData%.  If you have anything different, this may also be the cause for the install failure.

  • Intaract with oid and bring the all groups resides in oid through ldap

    Hi,
    i would like to intaract with oid and bring the all groups which were resides in
    oracle intrnet directory through ldap. can u please give me the procedure
    that i can follow or else suggest me a documentation regarding this .
    regards,
    srinivas

    try this (behaviour not garranteed):
    For local groups (groups within the Portal's group install base) you can program a loop on the table PORTAL.WWSEC_GROUP$ then read the column NAME.
    For non local groups, use the (unsupported) API wwsec_oid (function get_group_name_from_dn(wwsec_group$.dn) ) instead of reading the NAME column.
    If the result is incomplete (synchro issues with OID for instance due to DIP) you'll have to use ldap request with DBMS_LDAP package.(or java alternative, of course)
    Patrick.

  • I recently received an email telling me to delete and redownload the current season of Dr Who. But after deleting the episodes I see no option to redownload them

    I recently received an email telling me to delete and redownload the current season of Dr Who. But after deleting the episodes I see no option to redownload them.
    Dear iTunes Customer,
    Thank you for downloading the TV show Doctor Who, Season 7, Pt. 2. Unfortunately, the episode you received may have had issues with the audio. We have corrected the problem and a new copy is available to download, free of charge. To receive the new version, please re-download the title from iTunes.
    Before downloading the new version, remove the current version:
    1) Open iTunes on your computer.
    2) Click on your TV show library.
    3) Click the TV show to select it, and press the Delete key.
    4) Click Delete TV show and then click Move to Trash.
    To download the new version:
    1) Sign into the iTunes Store.
    2) Click Purchased on the right side in the iTunes Store under the QUICK LINKS section.
    3) Click on TV Shows and select the TV Season you want to download.
    4) Click the Cloud download icon next to the episode you wish to download.
    You will now have an updated version of the TV show in your TV shows Library.
    To delete and download the TV show from other devices, see http://support.apple.com/kb/HT2519.
    Sincerely,
    iTunes Store Team
    I only see the otion to download the most recent episode.

    That was it.  Thight I had deleted them all.
    Thanx

Maybe you are looking for

  • Spinning Cursor of Death on all actions and apps

    I now have the spinning cursor of death on all apps all finder actions in snow leopard over last 3 months, OS periodically dumped bluetooth, resetting the Sys management controller fixed this, also zapped the pram twice in this time.   in the last 10

  • AP_SUPPLIER_SITES_ALL- id explaination

    Can someone please explain the following 4 id's individually on the AP_SUPPLIER_SITES_ALL table? Are they needed? Where do I get them? Is there a parameter's table I am not seeing? Thanks. SUPPLIER_SITES TOLERANCE_ID LOCATION_ID PARTY_SITE_ID SERVICE

  • Download application from apple store is blocked

    Downloading applications from applestore is impossible as I always get a message asking to improve the security of my apple identifier.When I press "later" the downloading process never gets through. I am using the 6.1 version recently updated. Thank

  • Aperture 3 import of iPhoto 5 library

    Is it possible to import an iPhoto 5 library into Aperture 3? When I do a file > import > iPhoto library it correctly brings up the file browser pointing to the location of my iPhoto 5 library. However the import button is disabled - so the only opti

  • Making existing fields part of primary key

    Hi, There is a Z table(custom table), which has 3000 records. There are 12 fields in the table out of which 6 of them form the primary key. I need to make 2 more fields in the table part of primary key. Is that possible? Will it affect the existing d