Exchange 2007 and EWS Managed API: How can I add in-memory text file as an attachment to an email message?

Hello,
In my ASP.NET application, I need to add a text file attachment to an EmailMessage. I am building the attachment text content in a StringBuilder and I like to avoid saving it to disk and use Attachments.AddFileAttachment.
How can I add a text file attachment to EmailMesage based on in-memory string variable?
Thank you,

I found the answer.
This is the API:
http://msdn.microsoft.com/en-us/library/office/dd634274(v=exchg.80).aspx

Similar Messages

  • How can I add more memory to my iPad?

    How can I add more memory to my iPad?

    Memory refers to RAM, and can't be increased.
    I asume you mean storege space (like 16GB, 32GB, etc). It also can't be increased.
    There are some wireless external hard drives that can be used with the iPad.
    The Kingston Wi-Drive, which costs $50 for the 16 Gigabyte, and then $30 more for every 16 gigs more. It works by you turning it on and then accessing the files on it from an app that you download on your iDevice. You can access music, movies, and other stuff. No connections or anything, it works like a WiFi connection, you connect to it from the setting on the iPad under wireless networks.
    Then there is the Seagate GoFlex, which some would recommend over the Wi-Drive. But this one costs $199 and had 500 Gigabytes of storage. It works the sameway as the Kingston: no wires, runs over its wireless connection. You can actually fit up to 300 HD movies on it.
    Another option:
    Expand your iPad's storage capacity with HyperDrive
    http://www.macworld.com/article/1153935/hyperdrive.html
    On the road with a camera, an iPad, and a Hyperdrive
    http://www.macworld.com/article/1160231/ipadhyperdrive.html
     Cheers, Tom

  • How can i add Document Header Text for s_alr_87012357

    Hi Gurus
    How can i add Document Header Text for  s_alr_87012357(Advance Return for Tax on Sales/Purchases).do i need change the standard program or is there any alternate to do this please  help me  out.

    i found it .its in output list and i did change the layout settings.thanks

  • How can i add my report.rdf file in portal

    Hi,
    How can i add my report.rdf files in portal .. it's urgent and i have 30 report like to be executed based on user parameters....
    can anybody help me please... thanks in advance....
    vipin
    null

    hello,
    check the whitepapers on "security walkthrough" at http://otn.oracle.com/products/reports
    regards,
    the oracle reports team

  • How can I add more memory to my iPod touch

    How can I add more memory to my iPod touch?

    You are not able to add memory to a iPod Touch.
    The only way to get more memory is to buy one with a larger capacity.

  • I opened a PDFs file that was attached to an email message and now it will not close when I press "Done" as it usually does. Does anyone have a solution to suggest? Thanks.

    I opened a pdf file that was attached to an email message I received and now it will not close when I press "Done" as files usually do. Does anyone have a solution to suggest please? Thanks.

    Try double clicking your home button then force close the stuck PDF by swiping upward. Once you've done that just click the home button again to exit.

  • [office365 Exchange online][MVC5][EWS Managed Api] Need a hack to get access token ?

    Hi there, I am using following code example to get access token from Azure AD online. I need to bridge EWS managed api with office 365 Api via Azure AD. The below code is working just fine in my MVC application but I am looking for a way to get the access
    token in simple string returning  function so that I can use it to make call against EWS mananged api.
    private static string tempToken = "";
    public static string GetAccessToken()
    return tempToken;
    internal static async Task<OutlookServicesClient> EnsureOutlookServicesClientCreatedAsync(string capabilityName)
    var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
    var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
    AuthenticationContext authContext = new AuthenticationContext(Settings.Authority, new NaiveSessionCache(signInUserId));
    try
    DiscoveryClient discClient = new DiscoveryClient(Settings.DiscoveryServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(Settings.DiscoveryServiceResourceId,
    new ClientCredential(Settings.ClientId,
    Settings.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    var dcr = await discClient.DiscoverCapabilityAsync(capabilityName);
    return new OutlookServicesClient(dcr.ServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(dcr.ServiceResourceId,
    new ClientCredential(Settings.ClientId,
    Settings.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    catch (AdalException exception)
    //Handle token acquisition failure
    if (exception.ErrorCode == AdalError.FailedToAcquireTokenSilently)
    authContext.TokenCache.Clear();
    return null;
    This is an excerpt from Microsoft single tenant application in MVC5.  In the code, I have created a function called GetAccessToken() which does nothing.. I am hoping you experts can help me figure out how to transfer the accessToken from EnsureOutlookServcesClientCreated
    function which is actually returning token, to  my GetAccessToken() so that I can make call against EWS managed Api. Sorry, If I sound pretty stupid but I really need your help in this regard. 
    best regards,

    Yes sir, Let me try to explain me about my scenario. I need to use EWS managed Api with office 365 Rest Api to get benefits from both the Apis. Here is here code I am using to connect to EWS managed Api but it is failing with 401:Unauthorized.  I already
    have "Full Access" turned on in Azure AD.  I have the access token from AZure AD and want to use it to make call against EWS managed Api.
    var outlookClient = await AuthHelper.EnsureOutlookServicesClientCreatedAsync("Mail");
    //IPagedCollection<IMessage> messagesResults = await outlookClient.Me.Messages.ExecuteAsync();
    // Get the ID of the first message.
    // string messageId = messagesResults.CurrentPage[0].Id;
    string tokenx = AuthHelper.GetAccessToken();
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
    service.HttpHeaders.Add("Authorization", "Bearer " + tokenx);
    service.PreAuthenticate = true;
    service.SendClientLatencies = true;
    service.EnableScpLookup = false;
    service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
    // Get all the folders in the message's root folder.
    ExFolder rootfolder = ExFolder.Bind(service, WellKnownFolderName.MsgFolderRoot);S
    Scenario of my migration application:
    1. I have a Gmail mailbox email in Raw(complete email in base64-urlsafe with attachments) format with RFC2822. I need to migrate this mailbox to Exchange online. I believe EWS managed Api has better support on this one.
    2.  Likewise I need to migrate Gmail Calendars, Tasks and Contacts to Exchange online.
    I would be highly grateful to you , if you tell me how to bridge EWS managed Api with office 365 Api.
    best regards,

  • I have and Ipod touch, and new computer. How can i add all purchased and non purchased songs? The old computer with the original library is dead. HELP

    I have an  ipod touch 3rd  generation and a new computer. How can i add all purchased and non purchased songs into the new computers itune library? The old computer is dead! Will not even turn on. Help!!!!!!!! I'm going crazy.

    Look into downloading some type of iRip software! Allows you to transfer music from iPod to iTunes.

  • How can I add a description to a photo so it will be emailed with the photo?

    How can I add a description to a photo that I am going to email so it will be emailed with the photo? For that matter how can I add a description to a photo that will stay with (or on?) the photo?

    Add your description as you normally would. Then export the photo using the File -> Export command. In the resulting dialogue you have a number of options. If you check the box at Titles and Descriptions then these wil be written to the IPTC metadata of the files, and available in any app that understands this metadata.
    Regards
    TD

  • How can i add new identity in file option of menu bar

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/869755''
    how can i add new identity option in file option of menu bar

    There are, but not with a DVD written as a movie disk. It must be closed when completed, or it doesn't work.
    Apple's built in Burn utility also automatically closes any data CD, DVD or Blu-ray disk you burn. Doesn't matter how much space is unused, you can't use it. You'd have to use a more advanced disk creation app, such as Toast Titanium. I then have the option of choosing to write the data as a session:
    I can keep doing this until the disk is full. If I've written five sessions to the disk, when I put it in the drive, five CD/DVD icons will appear on the desktop since the OS will treat each session as if they are separate physical disks. At any point you choose Write Disk when writing a group of data, that means you're closing the disk, and again can't add anything after that. So if I had written two sessions, and the third was Write Disk, it's over. I can't put anything else on that disk.

  • How can I add/retrieve Word/Excell files to iCloud?

    I have an iCloud Account that I haven't used in the past. How can I add/delete/retrieve files such as Word & Excel files?

    To save arbitrary document types in iCloud on MacOS X 10.9.5 have a look at Winston Churchill's User Tip: 
    See this link:  Using iCloud to sync multiple document types.
    This will work between Macs, but not for mobile devices.

  • I got birthdays in my ical on mac and iPhone 4 but how can i add anniversaries

    I got a mac pro and have updated to mountain lion, i use the mac cal to synchronize to mac cal on iphone 4s and vise versa, I got birthdays on my cal but would like to add anniversaries to it as well how do i add them so i dont forget important dates and also in my icloud i have 3 colours for different entries e.g. green for holiday , blue for home and green for work, so how do i add another colour for something else for a different entries called "events" and add anniversaries like birthdays. Ta Juss p.s i also have a problem with birthdays they all duplicated.....

    Go to "File" and create a new calendar, name it "Events" or whatever you like and pick a color.  Then, go to the date you want the anniversary on and create an all-day event naming it however you like.  Under repeat, choose to have it repeat every year and select never for when it should end.  You will now have a calendar of anniversaries and other events.  Just make sure to select repeat every year and never end on each item you want in that calendar.

  • How can i add update signed jar file

    I am developing an applet which requires signing to run in a browser.
    I am developing supporting classes. But these class files have to be added
    to the jar. Isnt it??
    But to test the applet i need to load it in the browser each time i modify the class files. So the jar file need to be updated every time. But an
    IOError
    is being displayed when i try to update the signed jar file.
    How can i update signed jar file?? Or is there any othe way to test the signed applet during development??

    How can i update signed jar file?You can't, the signature is there to make sure the content of the jare hasn't been messed
    with.
    Either recreate the jar and re sign it or set up a policy during testing.

  • How can I add dots after text to fill the remaining space in a table cell?

    What is the most efficient way to add dots after text to fill the remaining space in a table cell? I know it is possible using tabs but is this possible using a table?

    You can put a tab inside a table cell using Option+Tab
    Then just set the right-aligned tab stop and the right edge of the table cell and add the leader.

  • How can I add or change cell number in iMessage settings.  Shows email only

    How can I change or add cell number in settings for iMessage.  It was there during set up but now doesn't show so that number can b changed to correct cell#

    I also already deleted my phone number from iMessage on my MBP.

Maybe you are looking for

  • BI Integration Wizard not opening

    Hi,     I have put the patches on EP7.0 from SP6 to SP10. Now there is a problem I am getting for BI in Visual Composer which is as follows:     After opening the Visual Composer, then I move through menu bar "BI" -> "BI Integration Wizard". Now a po

  • What is the difference betwee STRUCTRUE AND INTERNAL TABLE

    what is the difference betwee STRUCTRUE AND INTERNAL TABLE

  • Some of my presentations are no showing up in keynote

    My presentation from one year ago is now not in keynote on my macbook air or on my ipad, which I used to give the presentation. How can I get it back?

  • NO Planned order  after MRP

    Hi all first, I created PIR by MD61, then run MRP, but there is no planned order, why? how to deal with? in addition , in MD04 there is requirement created by PIR. I found in IMG, planning file entries consisten:variant has variant,  is it that no pl

  • Very weird folder created without my knowledge. Is this harmful?

    Hello, Here is a link to a folder that I found in the root of my Mac hard drive. Look at the name of the folder... http://pages.prodigy.net/dcifrths/strangefolder/whatisthis.jpg I didn't create it, and I don't know what did. Does anyone have any idea