powershell - link to attached file in mail message - powershell

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.

Related

Exporting, archiving, or saving ExactTarget mails

To preface this I'm not an ExactTarget expert.... We use ExactTarget and are interested in more archiving our email newsletters so that our subscribers can later use our articles as a reference. We have an archive folder set up in the exact target system, but that is not customer-facing and contains things like extra code.
As I understand it, the current process for archiving involves taking screenshots of the email that is sent out which is stitched together as a PDF. The PDF's are then stuck behind a password protected folder on a website.
Obviously, this is a hacky/low-tech way to do this.
Are there any ways to export these mails for archival purposes that people are using?
I am guessing from the above that you are using the premade templates and creating content using the Exact Target WYSIWYG editor. From there I am assuming also that these articles are in content boxes and HOPEFULLY each 'article' is in a single content box.
If so, then your best bet is to go to the HTML tab on this box and copy that code there and have this inserted onto your company blog (or website if you do not have a blog). Your network admin or website designer will likely know the best way to insert these snippets of code to fit the layout and navigation of the site.
If your message is not personalized, or if so you mdke a generic recipient in your list, you may be able to use the 'view as webpage' link to get the source code. Not sure if those links expire after X days or something though.I have never tried this or tested, but on most email sends there is a "view as webpage" link, maybe try taking one of these links and either hosting on your blog/site or using that link as a reference for your customers.
Using a PDF or screen shots is far from optimal as the content becomes an image and loses a lot of value.
Hope this helps.

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 browsers communicate with email programs?

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.

Email sent by SAP Workflow has partial Web hyperlink

I think this might be a simple question but I cannot seem to figure it out.
I have a workflow which simply sends a mail. In the content of the mail I
have a hyperlink going back to our SAP CRM system. I pass some parameters to this hyperlink.
The workflow works fine and the email is sent, however, the hyperlink goes onto the second line of the mail and becomes in active. If I copy the entire hyperlink and paste it in a browser it works.
The issue is I don't want users to copy and paste, I simply want them to click on the hyperlink.
Here is a screen print of what I am talking about
http://img402.imageshack.us/img402/9471/38348167.png
And here is a screen print of the actual email that is sent:
http://img210.imageshack.us/img210/6424/14370746.png
I tried going into transaction PFTC (Task Maintain) I entered my task and opened it up. I went to the tab description
and hit the edit button and I changed the tag column to continuous text but that didnt work, and then I tried extended line
and that too didn't make a difference.
Here is a screen shot of that:
http://img341.imageshack.us/img341/6254/37776438.png
My question is, is there any way to get the hyperlink on one line or even to have it be clickable on 2 lines?
Thanks so much.
From what I can see, that's a limitation of SAPconnect when sending plain-text emails. You could reconfigure the system to send HTML mails, but this would affect EVERY outgoing mail and should be handled extremely cautious. I'd suggest you write a small class to assemble and send the HTML mail and call it from the step. I'd use the BCS for sending the mail - it has an excellent online documentation and comes with several demo programs (BCS_EXAMPLE_*). You could assemble the HTML body using ABAP, although this usually yields rather messy code. Cleaner ways of ding this would be to either put all of the input data into a structure and use a simple transformation or dynamic documents (see for example report DD_ADD_LINK).

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