How do browsers communicate with email programs? - email

I've searched around for a bit, but haven't been able to find anything useful on this.
How do browsers communicate with email programs, such as Thunderbird and Outlook (on the Mac, if that's relevant)?
By communicate, I mean the process it goes through to create a new email window with a designated to address, subject, body, through the mailto: link. How does the browser let the email program know what to put for each field? Using the command line (for Thunderbird, at least) didn't make much sense, as that opens a brand new instance of Thunderbird on the Mac.
I haven't found any sort of API for this, so if someone can point me in the right direction, that would be greatly appreciated. Thanks!

On windows, the browser use the "default" email client defined by the system.
It's stored in the Windows registry and define the command line to open the mail program. You can find more info and an exemple on the Microsoft website.
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144109%28v=vs.85%29.aspx#sample_mail_program
If I look in my registry for thunderbird, It seems to execute:
"C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -osint -compose "%1"
I have no idea how it works for the mac!

the additional information sent to the mail client is usually (from what i have seen) tacked onto the back of the mailto command.
in the following example, the client should automatically fill in the subject as 'greetings from stackoverflow'
mailto:hello#example.com?subject=greetings from stackoverflow
i have listed the other commands i know of below:
to edit subject: ?subject=
to edit cc: ?cc=
to edit bcc: ?bcc=
to edit body content: ?body=
these can also be used together by placing them after eachother and swapping the '?' for a '&', example
mailto:hello#example.com?subject=hello there&body=goodbye
this should create an email with the subject of 'hello there' and a body message of 'goodbye'
i hope this helps!

A very useful oldies that explains the surface called RCDefault
It shows you that the Finder or the Browser uses (can use) URLs to call other applications.
I am attaching the screenshot for the Mail application on OSX here:
The OS will then call this application with the URL (or file) and the application is supposed to understand how to open that URL.
The URL scheme for the mailto protocol for apple, is here
You should be able to find other schemes for the application you need to use.

Related

How to embed an exe file into webpage?

I have a Windows executable, XAMPP, and ngrok. On the receiving end of my makeshift server, I would like my client(s) to be able to click a link that would open the before mentioned executable on my side, and stream the image to my user(s).
I would like if some user input could get through, as arrow keys & space bar, and I'm willing to do this by whatever means possible. Thank you!
You could look into CGI which provides a way for a webserver to interact with an executable via standard input and output. There is also a stack overflow answer detailing what CGI is. For user input, the CGI can pass data both ways, so it should be capable of what you are trying to achieve.

powershell - link to attached file in mail message

I can't find the solution for my problem. So, in my send-mailmessage html body is field that should be redirected to file which is included as attachment in message. How can I create hyperlink to that file in mail, when client opens it?
I don't know if you get my idea. In other words, in message I have attached file, and then there is field which should be a hyperlink to attached file. When client receives message he/she should press the link and then attached file opens.
I searched almost everything in everwhere but can't find a appropriate solution how to solve this.
This isn't really a PowerShell question, since this issue has nothing to do with the functionality of the Send-MailMessage cmdlet.
In any case, the reason you can't find a solution anywhere is that what you're trying to do is impossible. There is no way that a hyperlink in an e-mail message can point to a file attached to that message. Different mail clients on different operating systems store attachments in different locations. Even if you want to assume that all your recipients are running Outlook on Windows, there are different versions of both. Even if you know for a fact that all recipients are running a specific version of Outlook on a specific version of Windows, you're still out of luck. Outlook stores attachments in a subfolder in the Temporary Internet Files in the user's profile that has a randomly generated name. There's no way to inject code into a hyperlink in an email message, so without knowing the exact local file location, you can't link to it.
I suppose if you're really determined you could have the hyperlink point to a web page that runs some complex javascript code that tries to figure out where the attachment is stored, but that's a major undertaking, and would break if the recipient's default browser has javascript disabled.
Which begs the question, why exactly are you trying to do this? So that recipients can click once instead of having to double-click to open the attachment?
I have found that you can make a hyperlink point to a file share that you know the recipients have access to.
To do so:
Simply make each hyperlink point to the specific file and there you have it.
They have to have permissions to access that file share, or there is a much better way now that I haven't thought of.
Oh well, this works for me, for now.

Download attachments without browser

Does anybody know if it's possible to attach a big file to an e-mail and open it without opening a browser window? I mean, if I attach a small file, the file goes with the e-mail and I can open it without nothing more than the e-mail application. But when it's a big file (let's say 200Mb) normally I upload the file to an FTP, Dropbox, or other internet services. My client receives an e-mail with a link, and when he opens it, it starts a browser and he needs to click a link there to finally download the file. I would want to do that automatically, so my client only needs to click the link (or maybe drag'n drop) and it automatically downloads the attachment with no browser windows.
Do you think it's possible somehow? No problem if I need any programming language. Thanks in advance
It's not possible.
It would imply the use of Javascript that's not allowed in mail clients.

Openoffice Writer macro that uploads current file to a web service on save

I want to know if this is doable and get some hints about how to achieve this.
I guess at least it would need a confirmation dialog to run the (possibly evil) macro.
I want to produce an OpenOffice document that will upload itself on save to a hardcoded URL.
Is it possible?
What are the rough steps to achieve this?
My guess is:
bind a macro to the save event
have that macro get the current file binary data
have it post this data to a URL
but before researching about how to do this I need to know if this can be done in the first place.
I don't believe you need a macro to do this, instead depending on your OS you can map a FTP or other type of protocol remotely.
For example in windows you can "Map" a FTP as a drive and this would do exactly the same thing as your describing, you open the file from the FTP and upon saving it will then be written to the remote server. FTP is just an example here, there are other platforms you can use.
If you are at all interested in this method then following the instructions below, otherwise disregard.
Mapping a Network Drive in Windows Vista and 7.
Click on Windows start orb and then click on "computer".
Click on map a network drive.
Map a network drive will then open a new dialog box where you can click "connect to a website"
Simply follow that easy to use wizard and click add a new network location (Choose a custom network location)
Type in your FTP address, including username and password.
Finally name your network location to whatever you want.
Just a suggestion, I really don't think you need any macro unless you plan on distributing these files to other people then yes, but they would need to install that macro/plugin on their open office since there is no way to encode the document itself with such features as far as I know.

Send To/Mail Recipient from WSH

I am trying to implement in windows scripting host the same function as windows Send To/Mail Recipient does. Did not find anything usefull on google except steps to instantiate Outlook.Application and directly calling its methods.
I need to go the same path as windows do, as there is a mix of Outlook and Lotus Notes installed, I don't see it good to perform some sort of testing and deciding which object to talk to...
What I have found is that the actual work is done by sendmail.dll, there is a handler defined in registry under HKEY_CLASSES_ROOT\CLSID\{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE}. I would like either to use this dll somehow or to simulate the same steps it does.
Thanks for your input.
I found one item on CodeProject from 2003 that might be relevant.
The contents of the sent to menu in Windows is a bunch of files (usually links) in the C:\Documents and Settings\username\SendTo folder. You need to add your script - or a link to it - there.
For your script you could check if certain registry keys exist to detect Outlook and Lotus Notes.
Or if you don't care if the message shows up in sent items, just use CDOSYS.NewMail to send the message directly to the SMTP-server.
CDOSYS documentation