Create EmailMessage out of Aspose.Net Email MapiMessage? - exchangewebservices

Is there a way to create an EWS EmailMessage class instance out of Aspose.Net Email MapiMessage class instance?
I'm trying to use some common logic for email processing.
1) I have a service processing emails coming to an Exchange folder, and everything works just perfectly.
2) Also, I have users able to upload email files (*.msg) into the web app. These emails are processed using Aspose.Net.Email and I have an instance of MapiMessage as an output.
What I can try to do is to use MapiMessage .ToMailMessage() method, which will create an instance of MailMessage from this MapiMessage. But even after that, I wasn't able to find a way to create an EmailMessage to be able to use the processing logic from 1).
Any suggestions?

I have observed your requirements and if I am correctly understanding you are looking for support for interface between Aspose.Email MapiMesaage class and EWS EmailMesage class. These two classes belong to two different APIs and have no interface between them. Aspose.Email for .NET does allow saving as MSG or EML file format and you may load them on your end using EmailMessage class.
I am working as Support developer/ Evangelist at Aspose.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.emailmessage?view=exchange-ews-api
https://apireference.aspose.com/net/email/aspose.email.mapi/mapimessage/constructors/1

Related

Generate new ethereum account

I'm developing a ethereum dapp that can automatically generate new accounts (wallet addresses) for users immediately after a registration button is clicked.
It's pretty complicated for me since I'm a newbie in dapp development. Any solution on how to achieve this will highly be appreciated. I also have a Php script downloaded from GitHub link though it could be handy for account generation since I'm using PHP as a back-end but still confused on how to use the script.
Requesting help on using the ethereum-PHP script for account generation will also be appreciated. Thanks
Your question is quite broad, but you should be able to do what you wish by using either Geth or Parity. Personally, I prefer Parity. They have good documentation and their API is easy to use.
Parity.io
If youre using web3 in front end you could simply use web3.eth.accounts.create(<key>); and save it on front end.
If youre using Metamask it has their own way of handling account creation out of the box.
You could use the personal.newAccount() in php-ethereum but in that case youre generating the private key at the server end which could be a possible.
you need to use web3 for this task. In your sigup/register function file import web3 and connect it with you network. after that you can call two methods of web3 library.
one is web3.eth.personal.newAccount('password'): this function will generate account with keystore file . keystore file will be stored on network file directory.
second one is web3.eth.accounts.create(): this method will generate new account with private key of account which you can use to perform task on network .

set-userphoto using ews managed api 2.2

is it possible to set the user photo using the ews api 2.2? -- not a contact photo!
same as powershell command Set-UserPhoto
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
service.Url = new Uri("https://mail.xxx.xxx/ews/Exchange.asmx");
thanks
No this isn't possible because there is no underlying EWS operation to allow you to Set the user photo . There is a full list of the EWS operations on http://msdn.microsoft.com/en-us/library/office/bb409286(v=exchg.150).aspx.
One thing you can do with EWS that would be unsupported is modify the User photo object that gets created in the Root of the Mailbox. eg if you look at the Mailbox with a Mapi editor like MFCMapi and look at Items in the NonIPM Root of the Mailbox you'll see the UserPhoto object (it has a MessageClass of IPM.UserPhoto) if a userphoto has been set. In the object there are extended properties that have the Photo stored in all the different Image formats that are supported. But I don't think this method would give you a proper solution.
Cheers
Glen

How can Firebase be used for WebRTC signalling?

I've achieved a successful WebRTC connection using Firebase - but it only works if both users are on the same local network. I've tried using using different STUN servers, and even used TURN, but with the same result.
Is there any sample code or any place which shows how to achieve basic signalling for WebRTC using Firebase? I've tried looking at the docs, and there doesn't seem to be. What confuses me more is that my app works in the local network, but not outside of it.
Btw, I've also used PubNub and I've no problem using that to achieve signalling (even across networks).
I've set up a reference to my data like this
myDataRef = new Firebase('https://<myapp>.firebaseio.com');
myDataRef.on('value', function(snapshot) {
var json = snapshot.val();
and I communicate messages like so:
myDataRef.set(json);
The json message will include the action type (candidate, or offer or answer) and will also include the SDP, if required.
Any help on this will be appreciated!

Web browser control with single sign on to reporting services

My goal is to perform Single sign on functionality from my WPF application which has a embedded browser . Single sign on needs to be implemented for this so that the user should not be asked to enter this credentials again to check the reports from the wpf browser. I need to create a local environment for testing this functionality from my side since I am developing for a product i.e a sql report which has forms authentication and logging to the report from my application. I have browsed almost everything on the net regarding this implementation and the sample provided by microsoft for forms authentication is not working. I also find certain condition that the sample will not work in Itanium based processors etc.. and I am working on ssrs 2012. Sign on with capturing the DOM of reporting site and peforming the login wouldn't be a good idea since this is for a product and reporting login will not be same. I am thinking of implementing with Httpwebrequest and Response, but still not clear on implementing. Some one please provide me crisp and working solution for my implementation. Thanks in advance.
Some one please provide me crisp and working solution for my
implementation.
I wouldn't count on that, especially if you're asking for a source code solution.
Single sign-on assumes that you still have an authentication server somewhere, something like Google OAuth. From your question, it isn't quite clear to me if that's what your looking for. If you just need to supply custom credentials to WebBrowser control, that's still possible, but that solution is for WinForms version of WebBrowser control. The WPF version is sealed from customization, so you may have better luck hosting the WinForms WebBrowser in your WPF project, using WindowsFormsHost.
I finally found the way for Implementing single sign on for reporting services. The standard way for implementing single sign on for forms authentication is by using custom security extension sample. The configuration is a bit tricky, But once the configuration is done single sign on needs to be done by getting the auth token by calling Logonuser() methon in reporting service. The below code passes the credentials and returns auth token.
Configuring forms authentication can be found detailed here
http://www.codeproject.com/Articles/675943/SSRS-2012-Forms-Authentication
The below code helps me to achieve single sign on.
[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool InternetSetCookie(string lpszUrlName, string lpszCookieName, string lpszCookieData);
private void GetAuthToken(string username, string password)
{
// Step1: Add reference to report service either by directly referencing the reportinservice.asmx service of by converting wsdl to class file.
ReportServerProxy2010 rsProxy = new ReportServerProxy2010();
//Step2: Assign the report server service eg:"http://<servername>/ReportServer/ReportService2010.asmx";
rsProxy.Url = string.Format(ReportServerUrl, ReportServer);
try
{
rsProxy.LogonUser(username,password, null);
Cookie authCookie = rsProxy.AuthCookie;
if (authCookie != null)
{
//Internet Set Cookie is a com method which sets the obtained auth token to internet explorer
InternetSetCookie(Url, null, authCookie.ToString());
}
}
catch (Exception ex)
{
}
}
//When navigating now, the auth token is accepted and report manager page is displayed directly without asking for login credentials.
WebBrowserControl.Navigate(new Uri("");}

JSONP to HTML Table using PLUGIN

I want to convert the JSON-P exposed by WCF service to a HTML Table.
For this i am using a plugin:
http://ajaxstack.com/jsonreport/
(THis is a excellent plugin because it handles date very well..)
It has a function:
_.jsonreport(jop);
where jop shoule be a JSON data.
To get the json data i am using jquery get:
To use this:
$.get('http://localhost:1256......', function (jop) {
alert(jop);
var test = _.jsonreport(jop);
alert(test);
});
But i started getting PERMISSION DENIED ERRORS in almost every browser except IE
(Might be because of cross domain restrictions....).
Can i get complete json using ajax. Actually ajax returns objects not complete JSON
How can i tackle this.
Any help is appreciated
I think you can us typical jsonp for this. Have you used it at all successfully in not IE browsers (IE being a microsoft prod, allows ur localhost to access xDomain if you've visited and deemed the other domain safe).
If u cannot use regular jsonp, I suggest using flyJSONP/YQL, jankyPOST/jankyPOST techniques.
reg jsonp:
script src="somedomain.com/somepage.json?myCallbackFunction=jsonp" /script
function myCallbackFunction(data){
return data
}
Hope this helps...
I am using two different projects one for service and one for application in asp.net both application run on localhost with differnet port number and IE does not support cross domain so it throws an error.
So to fixed this i need to combine both projects.