How to open the mail window in Thunderbird from an extension? - thunderbird

I'm developing an extension for Thunderbird, and want to open a message, just like a double-click in the inbox folder. I do have the message references (messageID / messageKey). How do I open the dialog?

Found out how it is possible, the MailUtils module provides some nice functions. You need the message header, though, and not the message as e.g. found via Gloda. So you have to convert them first.
So, first import MailUtils:
Components.utils.import("resource:///modules/MailUtils.js");
and then use the functions, e.g. displayMessages or openMessageInNewWindow, as defined here:
http://mxr.mozilla.org/comm-central/source/mail/base/modules/MailUtils.js

Related

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.

how do I set a Thunderbird signature to use a dynamic url's html?

I want to use a dynamic email signature in Thunderbird, that is context aware (depends on date, events in db, etc.)
If I have a PHP that can generate the signature html (i.e. http://www.site.com/email_sign.php)
how do I force Thunderbird to use it?
(the only options I see are using static html (whether inline, of from a local system file).
any ideas?
You can use the Signature Switch add-on and a batch file calling wget to achieve what you want. I wrote a simple executable to replace the bat file; you can read about it (and download it if you want to) from http://www.else.co.nz/portfolio/020-code/dynamic-email-signatures
I doubt you can do this simply. Thunderbird does allow scripting via the creation of plugins but I wouldn't personally know how do do it or how easy it might be.
Best answer I can think of would be to set a scheduled task / cron job to download the php to a local file then follow the instructions in the knowledge base, namely:
You can use Thunderbird to create signature files, or you can use your operating system tools to create them—for example, a plain text editor.
Thunderbird does not provide any
special place to store signature
files. You could create a Signatures
directory in your profile to store
them, making them easy to back up
along with the rest of your profile.
Or you could store them somewhere
else.
To use a signature file, specify it in
Account Settings as the signature for
an identity. Check the box "Attach the
signature from a file instead" and
specify the signature file.
This will work unless Thunderbird caches the HTML internally, however I see no indication in the FAQ that this is the case.
For years I updated the signature for my email client manually – until I got fed up… That’s why I wrote a PHP script to create a randomized signature block automatically from an RSS feed! Check it out: https://github.com/birdy1976/signature :-D

Lotus Notes email as an attachment to another email

This is in Notes 8.5 environment.
I just wanted to know how to attach an email to another email as real attachment not a "Document Link".
I intended to attach an email, so I drag & dropped an email to another email's body but this turned out to be a "Document Link". This is an issue when I deleted the original attachment(an email in this case) and want to open the attachment again.
Tried to drag & drop the email to desktop and attach that through the "Choose file" dialog, didn't work either.
So how can I do that? I'm trying to get the attachment programmatically.
The only way I know is this:
Reassure that preferences | Basic Notes Client configuration | Drag and drop saves as eml file is checked
1) Drag your email to e.g. your desktop or to an explorer instance (will be saved as an eml file).
2) Attach this file to your opened email by either selecting it with the paperclip menu item or drag 'n drop the file into the opened email.
Open msg
Save to desktop
Open new mail
Attached *.eml file on desktop
Sad to say, this is the only way I know which sux because in Outlook, you just need to copy and paste.
Answer from Chris is not possible
because there is no save mail option
(at least in version 8.5) in LN
It is possible, File > Save As
answer from Alexey creates MS Outlook eml files, so if you don't have Outlook e-mail client doesn't help.
Answer from Chris is not possible because there is no save mail option (at least in version 8.5) in LN.
So one of the possible solutions would be to hold control, select all mails you want to attach, right click on the selected mails, from the menu select Forward and it will open the new message with all selected mails in the body of the new message.
You can slecet sent item /email and drag to desktop , it will automatic created new file on desktop. Then you can attach and send it in to new emails.
I have recently encountered the same issue and hopefully what follows will be helpful.
In Windows, the default program for opening .eml files is set to Outlook. Every user of Lotus notes should take the steps to have .eml files defaulted to open via Lotus notes.
Start menu--- Defaults programs---Lotus notes-- and check .eml--- then save.
After performing this, Lotus notes will be the default to open these attachments.
I have been trying to do this for a while also.
Here is what I do now.
Highlight the email you want to create as a file.
Click on Create. Hover over Special, then click on Link message.
This will open up a new tab for the link.
At the bottom of the message is a small yellow piece of paper icon.
Copy this icon and paste into your message like you would any other file.
It is tiny, so I put a statement like "see email attachment ---->" in front of the icon.
You might like this way. Not sure though.
Tested vith Notes versions 6.5.x and 7.0.x
From your Lotus Notes inbox
Open the message
Click View > Show > Page Source
Copy all the data into a text file and save the file with .eml extension.
Create a new message
Attach the .eml file(s) and send the new message
Hop this helps. I have no client on my current machine but will test from home on 8.5.1
Copy the mail as a document link (right click on the mail and you should get this option) and paste it in the new mail. This worked for me
Talking about IBM Notes v. 9 is pretty easy.
To choose the e-mail to be attached and drag until the new e-mail.
Click on email which you want to forward
Edit - > Copy As -> Document Link
create new mail and paste.
it will work
If you are using Lotus Notes V9.X, it is better to drag the mail to desktop as .eml and then attach it to the mail. Safest way so far.
Although probably not exactly what your looking for and you probably don't care at this point since the question was asked 5 years ago, one method is to use "forward".
Go to your inbox or wherever your messages are and select the 2+ messages you want to send than simply click forward... all messages get combined into 1.
I might be very late but encoutered this problem sometime before and saw this link.
Thanks . Please check this shall work.
Goto Create menu -> Section--> Copy email to be inserted

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