How to retrieve from email from Exchange server Mail Account ?

Dear All,
I get the email in my mail box from [email protected]
I need to retrieve the from email address but i am unable to get this.
Following is code i am using.
Folder boundFolder = Folder.Bind(service, WellKnownFolderName.Inbox);
                FindItemsResults<Item> unreadMessages = boundFolder.FindItems(unreadSearchFilter, itemView);
                if (unreadMessages != null && unreadMessages.Items != null && unreadMessages.Items.Count > 0)
                    foreach (EmailMessage message in unreadMessages)
                        string subject = message.Subject.ToString();
                        string strfromEmail = message.From.Address.ToString(); // I got Error of Object Refrence
                        string strDisplayName = message.From.Name.ToString();
How can i retrieve from email using C#? 
Thanks and regards,
Hardik Ramwani

The From Address isn't returned when you use FindItems see
https://msdn.microsoft.com/en-us/library/office/aa566107%28v=exchg.150%29.aspxto return the From Addresss you need to use either Load or loadpropertiesforitems see
http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx
Cheers
Glen

Similar Messages

  • Multiple exchange e-mail accounts in outlook 2013

    Hello. I'm trying to set-up two exchange e-mail accounts in outlook 2013 (Exchange server is synchronized with Active Directory).
    Once I add second account and restart outlook I get password prompt from each of the accounts. And it keeps prompting all the time and one of the accounts do not work. Could you please assist me on how to set-up those multiple exchange e-mail accounts correctly

    Setup the second Exchange account in one profile would always keep prompting usernam/password. This is limitation of Outlook profile.
    To work around this, I recommand that you may use the tool as below:
    http://www.codetwo.com/freeware/autologon/
    Note:
    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
    Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
    completely understand the risk before retrieving any software from the Internet.

  • Help with Moving Emails from Exchange Server 2013

    Hi Team,
    Help, I need a solution on how to copy incoming and outgoing emails together with their attachments and was hoping someone could help with a solution I need to find for this problem.
    1) I have a need to copy all incoming and outgoing emails & attachments from Exchange Server 2013 mailboxes on a daily basis, so they can be archived into an external 3rd party database overnight.
    I believe that the first step is that I can set up another Exchange mailbox, through Journaling to receive these emails. 
    Is there any way that these emails can then be moved direct from the Journaling mailbox that I have created, to a shared folder on the network? If so what format would they be sent out as e.g. .msg, .ems and what is the process?
    Failing that, could they be sent to an Outlook client (not another Exchange mailbox) on the network and stored in a .pst file? (I have a program that will export them from .pst)
    I would really appreciate any assistance that you can provide in this matter.
    Regards, Greg.

    Hi,
    You can set auto-forward on journaling mailbox and auto-forward emails to another mailbox. Why don’t directly archive the emails from the journaling mailbox “an external
    3rd party database”.
    Thanks,
    Simon Wu
    TechNet Community Support

  • How to keep your email on the server after deleting from the phone?

    how to keep your email on the server after deleting from the phone?

    If this is a POP mail account:
    Settings > Mail.... > Your account > Advanced > Delete from server > Never.
    However, this will risk re-downloading as new mail
    IMAC  accounts mirror what's on the phone in the server, so deleting from the inbox on the phone will either send it to the trans folder on the server or leave it in the inbox but marked as deleted (depending on the server)
    Settings > Mail.... > your account > Advanced > Deleted Mailbox > On My iPhone Trash

  • Outlook Calendar invite - Not able to send from exchange server.

    Hi,
       I am not able to send outlook calendar invite from exchange server. But if i installed outlook on my local machine/server it works fine. Below code the i used to build calendar invite for your reference.
      public static void sendOutlookInvitationViaICSFile1(EAppointmentMail objApptEmail)
                try
                    log.Info("Invite Started");
                    Microsoft.Office.Interop.Outlook.Application apptApp = new Microsoft.Office.Interop.Outlook.Application();
                    Microsoft.Office.Interop.Outlook.AppointmentItem agendaMeeting = apptApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
                    DateTime venueDate = Convert.ToDateTime(objApptEmail.VenueDate);
                    string formatedVenueDate = venueDate.Year.ToString() + "/" + venueDate.Month.ToString() + "/" + venueDate.Day.ToString();
                    DateTime from = Convert.ToDateTime(formatedVenueDate + " " + objApptEmail.FromTime);
                    DateTime to = Convert.ToDateTime(formatedVenueDate + " " + objApptEmail.ToTime);
                    System.Net.Mime.ContentType typeHTML = new System.Net.Mime.ContentType("text/html");
                    //Create the Body in HTML format
                    string strBodyText = "Type:Single Meeting\r\nOrganizer: {0}\r\nStart Time:{1}\r\nEnd Time:{2}\r\nTime Zone:{3}\r\nLocation: {4}\r\n\r\n\r\n\r\n{5}";
                    strBodyText = string.Format(strBodyText, objApptEmail.Email, from.ToLongDateString() + " " + from.ToLongTimeString(),
                                        to + " " + to, System.TimeZone.CurrentTimeZone.StandardName,
                                        objApptEmail.Location, objApptEmail.Body);
                    if (agendaMeeting != null)
                        Console.WriteLine("started");
                        agendaMeeting.MeetingStatus =
                            Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
                        agendaMeeting.Location = objApptEmail.Location;
                        agendaMeeting.Subject = objApptEmail.Subject;
                        agendaMeeting.Body = strBodyText;
                        agendaMeeting.Start = from;
                        agendaMeeting.End = to;
                        Microsoft.Office.Interop.Outlook.Recipient recipient = agendaMeeting.Recipients.Add(objApptEmail.Email);
                        recipient.Type = (int)Microsoft.Office.Interop.Outlook.OlMeetingRecipientType.olRequired;
                        ((Microsoft.Office.Interop.Outlook._AppointmentItem)agendaMeeting).Send();
                        log.Info("Invite Successfully End");
                        Console.WriteLine("End");
                catch (Exception ex)
                    log.Info("Error: " + ex.Message.ToString());
                    Console.WriteLine("Error: " + ex.Message.ToString());
    In exchange server/ not outlook installed server, i am getting below error.
    "Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
    Help me to send calendar invite without installing outlook on the specified server. Please do the needful.

    Hi
    It is probably that the stuff you doing is for outlook and because outlook is not installed it cannot find the classes.
    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • EWS Push Notification : Notification Service is not getting called from Exchange Server.

    I have written 2 web services 1) Subscribing to Exchange Server 2) Notification client
    I am able to create subscription to Exchange Server. But from Exchange server my notification client webservice is nt getting called. I am not sure how i am missing out any setting. below is my subscribe code and notification client code.
    Subscribe code :
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                    service.UseDefaultCredentials = true;
                    service.Url = new Uri(exchangeServerurl);
                    FolderId parentId= FindFolderIdByDisplayName(service, "Order", WellKnownFolderName.PublicFoldersRoot);
                     pushSubscription = service.SubscribeToPushNotifications(
                                new FolderId[] {FindFolderIdfromRoot(service, "EmpCreatealert", parentId)},
                                new Uri(notificationService)         /* The endpoint of the listener. */,
                                1                              /* Get a status event every 5 minutes if no new events
    are available. */,
                                null                           /* watermark: null to start a new subscription. */,
                                EventType.NewMail);
    Notification client : 
     public class Notification : NotificationServicePortType, INotification 
            public SendNotificationResponse SendNotification(SendNotificationRequest request)
                log("Enter SendNotification");
                SendNotificationResponse snr = new SendNotificationResponse();
                snr.SendNotificationResult = new SendNotificationResultType();
                snr.SendNotificationResult.SubscriptionStatus = SubscriptionStatusType.OK;
                return snr;
    Can anyone suggest me what els i should do to get notification client to get called.

    How are you testing this ? Are you just creating posts in the Public Folder or is the folder mail enabled and your sending email to it ?
    Are you getting the heartbeat notifications ?
    Have you tested your endpoint is accessible from the Exchange Server ? are you getting any error logged see
    http://www.infinitec.de/post/2009/06/21/Troubleshooting-Push-notifications-failures.aspx
    Your only subscribing to the NewMail event on public folder I would suggest at least for testing you subscribe to the CreateItem, MoveItem, DeleteItem events as well to see if other event fires when you create and delete Items in the folder. You might also
    want to test something like
    http://blogs.msdn.com/b/emeamsgdev/archive/2012/12/20/ews-push-notification-sample.aspx which is a basic sample
    Cheers
    Glen

  • Workflow task details are being retrieved from the server

    Hi,
    Using an approval workflow. when the task has been assigned to the person he is getting an email but when clicking on the edit this task button ,the pop window with the
    "workflow task details are being retrieved from the server" 
    error is getting. SharePoint site 2007 and Microsoft Outlook is 2010.

    I have a similar issue with my version of SharePoint. 
    SharePoint 2010 Enterprise.
    Outlook 2013 with MS Exchange
    Document approval workflow.
    When you open the document approval email that comes from SharePoint and click on "Open this task"  the popup window flashes across "workflow tasks details are being retrieved from the server ".
    I've tried the regedit fix and the hive fix and resetting IE that some of the other people have said that works and it doesn't. 
    When I go the site, and connect the task list to Outlook, I can complete the task that way.
    I also created a new approval workflow in SharePoint designer and it behaves the same way.
    Anything else I should try?
    == Steve Morley MedIT, Dalhousie University

  • Migrate Notes from Exchange server 2007 to office 365

    Hi,
    Anyone help me to how to migrate notes from exchange server 2007 to office 365 . My customer having notes on his existing exchange account  . We would like to move notes to office 365 . 
    Please help me or guide me .
    Thanks & Regards,
    Vinoth

    The way you're doing it has two very high hurdles.
    First, you have to get the data out of an offline server and into Office 365.  That's hardly a trivial task.  If the server were online and reachable by the Internet you could use a move request or a third-party tool like MigrationWiz.
    Second, if you do get the mail moved, you will want to synchronize the legacyExchangeDN attribute from the old organization into an X500 proxy address in Office 365 for all mailboxes to preserve mail replyability.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Migrate from Exchange Server 2011 to Mac OSX Lion Mail Server

    Hi all,
    I'm looking to migrate from Exchange Server 2011 to Mac OSX Lion Mail Server.  I work for a company with roughly 30 employees and they use exchange for mail, contacts and calendars.  We want to take full advantage of OSX Server and to completly get off of exchange.
    What are the best ways to do this?  Are there any tools available to help this process?

    I agree with the points made by Strontium90. If you have any PCs then Apple's mail/contacts/calendar software is a poor choice. Kerio Connect as a mail/contacts/calendar server would not only support Macs but would also do a good job supporting PCs running Outlook.
    If you are going to become a pure Apple site, then you could use just the Apple software and this would be cheaper than using Kerio. For 30 users this might be a suitable solution, however even in a pure Apple environment many people prefer Kerio. For example I find Kerio much more pleasent when dealing with email addresses across multiple domains, email aliases, email group addresses, and so on. Kerio also has built-in email archiving, that is keeping a record of all emails. Kerio also provides a web-browser client for accessing email, calendar and contacts. It is worth noting that as standard Mountain Lion Server no longer includes a webmail feature. While I personally find the Kerio webclient rather ugly it does work.
    There are some annoyances I have with Kerio, firstly they have always charged a 'maintenance' fee for their software. This provided access to software updates, and in the past also provided access to Kerio technical support. Unfortunately they now only let you make two (2) support cases per year for that cost, and you now have to pay extra for any more cases. Also while they added support for EWS (Exchange Web Service) to allow using Outlook 2011 for Mac as a supported email client, they did a poor job of this so that it does not work properly with any other EWS compatible client. This means it will not work in EWS mode with Apple Mail, nor with Outlook for Windows. While there are other ways to connect these other clients, this seems a foolish move and there have been plenty of requests to fix this.
    Apple's Mail client uses EWS to connect to a 'real' MS Exhange server.

  • Can I download emails from a web mail account? If so how? thank you?

    How can I download emails from a web mail account into Thunderbird please

    If the account can be set up with programs like TB, simply add the account, starting from File/New(or AppMenu/New Message)/Existing Mail Account. If TB doesn't detect the right settings, enter them manually according to the account provider's requirements. If the provide offers IMAP access, all of the webmail folders will be downloaded. If POP only is offered, the Inbox will be downloaded.

  • How to configure canon ir 2250 to send scans to emails via exchange server 2010

    Hello
    I have one question:
    How to configure canon ir 2250 to send scans to emails via exchange server 2010?

    Hi,
    Based on my research, the member limit of a distribution list depends on the scalability and performance of your environment:
    http://blogs.technet.com/b/exchange/archive/2009/02/19/3407003.aspx
    Thanks,
    Angela Shi
    TechNet Community Support

  • Upgrade directly from Exchange Server 2010 SP1 to Exchange Server 2010 SP3

    Hi,
    We have current setup with Exchange Server 2010 SP1 ( DAG & CAS Array with WNLB).
    Can we upgrade directly from Exchange Server 2010 SP1 to
    Exchange Server 2010 SP3 . ? 
    Thanks in Advanced.
    Regards,Ali

    Hi Ali,
    Yes, you can. Please upgrade your Exchange 2010 SP1 server roles in the following order: Client Access, Hub Transport, Unified Messaging, Mailbox, Edge Transport. What's more, please note that when you install a Service Pack or update rollup on a server
    that's a DAG member, several services will be stopped during the installation, including all Exchange services and the Windows Cluster service.
    For more information, here is a helpful article for your reference.
    Installing Update Rollups on Database Availability Group Members
    http://technet.microsoft.com/en-us/library/ee861125(v=exchg.141).aspx
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Can we send bulk email through exchange server 2010

    can we send bulk email through exchange server 2010

    You can do this however not sure I would recommend that since if people complain they are getting spammed it could effect your production servers domain/IP, i.e. it could get black listed.   Personally I always recommend using a different system for
    email blast  to protect my production IP addresses and also to keep the load off of exchange as well as email marketing systems have built in capabilities for reporting, opt in/out capabilities etc.
    All of that said perhaps you can tell us more about what exactly it is you want to do and how often?
    Search, Recover, & Extract Mailboxes, Folders, & Email Items from Offline Exchange Mailbox and Public Folder EDB's and Live Exchange Servers or Import/Migrate direct from Offline EDB to Any Production Exchange Server, even cross version i.e. 2003 -->
    2007 --> 2010 --> 2013 with Lucid8's
    DigiScope

  • Deleting emails on Exchange Server

    I have an iPhone that I can receive emails from my OWA exchange account. When I delete the emails on my iPhone they are just marked as read on my OWA account. Must I delete them twice (once on iPHone & once on server) or is there another way?

    I spoke with a guy at Apple support about this yesterday. It seems I knew more about the iPhone than he did. He said it was the way the exchange server / owa account was configured and I would have to talk to my IT dept. I'm at a dead end because they're not real helpful. Until apple comes out with something to really sync with an exchange server I guess we'll have to delete our emails twice.

  • How to install and configure ms exchange server 2007 both role hub and edge transport role in one network

    How to install and configure ms exchange server 2007 both role hub and edge transport role in one network 

    Hi,
    Edge role is design for perimeter networks, to keep security risks minimum.  So it’s not recommended to have edge role in internal network. Must have separate network or subnet for edge services.
    If you are playing around it in labs, then you can put edge role within same subnet as other exchange roles and no specific requirements in that case.
    Thanks.
    MachPanel - Premium Cloud Automation Solution

Maybe you are looking for

  • Finder won't open - continually crashes and asks me if I want to reopen windows

    I have no idea how to fix this. It began right after I installed Mavericks on my 2010 Macbook Pro 13". Finder will not open. It keeps crashing with a pop-up window that tells me that Finder isn't working and asking if I want to try to reopen windows

  • Problems with Windows Media Player for OSX and IMAC G5 Intel Duo

    I was able to download Windows Media Player 9 for Mac but when I surf on the net and I click on the WMP files, instead of opening automatically, it downloads the content and only then lets me open it. Also, with live streaming, when I click for the w

  • Cannot fax 1 800 / 888 / toll free numbers from overseas

    Dear HP, I'm writing because using your fax machine from Germany (or Europe in general) for doing work with US firms is almost impossible. Since the US has had many fax numbers move from traditional area codes to 800 or 888 (free numbers) I am often

  • How to use jsp:scriptlet in site template

    hi all, I want to use <jsp:scriptlet> in site template, but jdev showed me an error msg when I put <jsp:scriptlet> in site template: scriptlet can not work properly with OJSP, I checked the forums, one possible solution is to encapsulate java code in

  • IPhotos in Trash bin - help!!

    Somehow all my photos (about 16000) ended up in the iphoto trash bin...is there any way to get them back?  I'm afraid the trash will get emptied and I will lose them all...Any help would be appreciated.  Thank you.