Open windows form from link in outlook? - c#

I would please like to find out how I can launch a windows form written in c# from a link in outlook. Changes in my db will send n mail from which my application should be able to open so that the user can upload documents to a shared folder on a server.
Can someone please advise me on this thank you

You can register application with your custom protocol. In example, you can create protocol myAppProtocoland associate it with your application (ie. c:\apps\myApp.exe). Then, you can send link in mail which looks like myAppProtocol:something. When user clicks on that link, it will open your application with passed parameter something.
Take a look at following resources:
MSDN article
SO question
or use third-party solution

Related

C# Sending gmail with uploading large file on Google drive attachment

I need to create a program in c# that can upload to google drive and attach it to email(gmail) and send it to recipients. The file is more than 50mb that is why we need google drive to send. Is there a google api available to do those task all in one? Is that possible? I have been reading solutions here but mostly uploading file to google drive and sending email are separate solutions and I am having a hard time combining those two task. Can somebody direct me if there is a proper code or api to do those task.
The program will provide the following information
sender email: username
sender email: password
upload directory and file
recipient or email receiver
#Mandz Yeah, I'm not sure if there is an automatic way of attaching the file to the Gmail's e-mail, however, the way Gmail handles links is quite interesting:
As you can see, it attaches the link to the attachment, making it in some way automatic.
Here's the link to the GitHub repository:
link
I've decided to make it GUI using WPF and MVVM pattern (using Caliburn.Micro). Hopefully, it won't be too difficult to run the sample app on your end.
Here are the steps that you need to do in order to run the app:
Have a Google account.
Login into https://console.developers.google.com/ (It is a platform where you handle all your tokens etc.)
Create a new project - top left, click on Select a project, new window should appear, click on New Project, name it whatever you want, when that's done, click on Navigation menu (top left), APIs & Services -> Library, Search for Google Drive and Gmail API, enable them both. Then go to Credentials (In APIs & Services), click Create credentials, choose OAuth client ID, you might need to configure consent screen (but I think it's pretty easy, you have to choose either Internal or External and provide the Application Name), in Create OAuth client ID, choose Other, name it whatever you want, Click Ok on the new window, then Download JSON on Credentials Page (on the right), place the file in the same dictionary where the .exe app is. Then create another credential for Gmail token (the same way as above I believe). Place it again in the same dictionary where the .exe app is.
To run the app, you will need .NET Core 3.1 https://dotnet.microsoft.com/download (or just new version of Visual Studio)
Build the app, Click the Choose button to select a file, then Click Upload button.
If the tokens are in the same dictionary, a new website should launch and ask you to log in to an appropriate account (I would choose the same Gmail account where you created these tokens) then if you give access to this app, agree to that. When that's done, a token folder should appear in the same dictionary as the .exe file. The reason why the token folder is created is so you won't have to repeat the 6th step.
A downloadable link should appear, copy it and paste in the Text field in the E-Mail tab.
Type the E-mail address (I would suggest your alt account or something so you can just test it).
A subject field can be empty.
Click Send-Email (now just redo the 6th step)
Some side notes:
I had to create two tokens, for Drive and Gmail APIs, I dunno if it's the quickest way of doing this, I tried to just use 1 token but it didn't want to work.
MainView.xaml is just the things that you see, so it doesn't really matter in this case.
MainViewModel.cs is the file where all the important things for you are.
I would look at UploadFileAsync method, it does upload to the root folder (the main folder of Google Drive), then puts the file to the public so anyone can access the file and download it, then gets the public link to the file.
SendEmail method sends the E-Mail.
I put these methods asynchronous so the app won't just freeze (hopefully it won't be a problem for you).
The code is not perfect but I think it will do as learning material.
Feel free to post any questions about it, below. Good luck.
Edit: If you want link like this instead of full link, you change in string plainText to "<p>test<p>"

How to connect a Program with a Protocol like Skype uses (callto:) Outlook uses (mailto:)

I just wanted to know how to open a desktop app written in vb.net or C# when user visit my website and click a link like:
Click here
what is the simplest way to perform this action?
Look up how to register a protocol handler, here may be a good starting point: http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx This is generally something that you'd do in your installer.

share a message in Linkedin via windows phone

want to share a link from my application in windows phone 7. Any one know a good API library for this.....I have downloaded a API from a site which shows null information like this
Usage
1. Create a button that sends the user to a page where the login process will start like LinkedInBeginAuth.aspx or Account/LinkedInBeginAuth in MVC
2.Inside LinkedInBeginAuth Page add the following code
Create the page that the user will be redirected after login
Inside that page add
5.That's it!
Library is in EARLY development so expect major changes. Use it wisely.
Have you looked at the ShareStatusTask :-
http://msdn.microsoft.com/en-us/library/hh394027(v=VS.92).aspx
If you want to use the LinkedIn API you'll need to connect via OAuth. (You can do this with Hammock & a WebBrowser control.)
Once connected you can call their REST API.
Alternatively, or possibly as a starting point, you could look at http://linkedintoolkit.codeplex.com/ but it doesn't look complete.

How to open a Client app through a browser? like Secondlife.com does it to open second life client

I am trying to write and application on windows where my application shud be prompted to open thru a browser link. how can I do that?
I don't know about second life, but I would register an file extension (like .MyApplication) with my application and create links to a .MyApplication-file on the web site. You an also encode special startup parameters inside that little file.

Outlook Email via a Webpage

I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side. I understand that Office is designed to be run on the desktop and not from a server, however I have no trouble creating a Word or Excel document on the client-side.
I have code that instantiates the Outlook object using the Microsoft.Office.Interop.Outlook namespace and Outlook installed on the server. When I try to run the code from the server, I get a DCOM source error message that states "The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {000C101C-0000-0000-C000-000000000046} to the user This security permission can be modified using the Component Services administrative tool." I have modified the permissions using the Component Services tool, but still get this same error.
Is there a way to overcome this or is this a fruitless exercise because Outlook cannot be opened on the client side from the server-side code?
Mailto will not work due to the extreme length that the emails can obtain. Also, the user that sends it needs add in eye-candy to the text for the recipients.
You cannot open something on the client from server side code. You'd have to use script on the page to do what you're wanting (or something else client-side like ActiveX or embedded .NET or something)
Here's a sample Javascript that invokes an Outlook MailItem from an webpage. This could easily be injected into the page from your server-side code so it executes on the client.
http://www.codeproject.com/KB/aspnet/EmailUsingJavascript.aspx
(hint: formatting in your question)
I'm not understanding what's wrong with a mailto link or a formmail-type page.
If everyone in the company uses Outlook, then just using a standard "mailto" link should always open Outlook. It sounds like you're over-engineering this.
I'll just throw this out there cuz it's been asked.
Mailto has a lot of disadvantages; mainly size. Since the sender needs to do alot of formatting on the email text, the html code generated can take up a lot of space that fails when using mailto.
thanks for the suggestion though.
Do you want to open an existing E-Mail or create a new one?
Perhaps I misunderstood your question; could you provide a link like:
mailto:recipient#email.tld?subject=This%20is%20the%20subject&body=Hello%20there!
When the user clicks on that a link, a new Outlook-E-Mail will be opened and the:
Recipient: recipient#email-tld
Subject: This is the subject
Body: Hello there!
All these fields are already filled from the link.

Categories