Sharepoint: use mailto command to send subject and body - email

I am developing in SharePoint and I would like to prepare a mailto command but I would like to send two values to the email and not just one. Normally in html the command works
Email
But in SharePoint I seem to only be able to send the first section after the email#here.com?. Depending on what I position first, I sometimes get the #Body field to go through or the #Title to go through. It appears that for some reason the "&" isn't accepted. I also tried %26 in the place of & with no result.
What is the best method to get both (body and subject) to go through to the mail-client?
Thank you in advance for your time, any guidance will be greatly appeciated

Related

Cannot pass url variable through Campaign Monitor Newsletter Email

I doing a newsletter where I need to pass 2 variables, token and email address to the URL to another website. The problem is that Campaign Monitor makes the URL it into the ShortURL which doesn't work in my situation.
This is how the URL should look like
http://www.example.com/newsletter/index.cfm?token=yes&email=[email]
This is how my Email Link Looks like
<a style="color:#263269;font-size:30px; font-weight:bold;text-decoration:none" href="http://www.example.com/newsletter/index.cfm?token=yes&email=[email]">YES</a>
Please advise me if theirs any alternative solutions for this issue. I cannot seem to find any solutions on the their official website.
Have you tried passing the values from the form and set action to get.
edit: try using ascii value of ampersand &AMP; (amp should be lowercase)
try removing the "&" and adding "&"

Is it possible to hack mailto?

Sorry about the provocative subject but I could not think of a better word than "hack" to describe what I would like to do!
On my site, I provide links to other sites and on request by the user, display a page from the site in a frame or pop up window. Frequently these displayed pages have a mailto-tag.
I have found it extremely annoying that clicking the mailto link starts off my outlook which I no longer use but retain it as an installed program on my machine.
What I would like to do is:
1) Pick up the subject and email address part of the mailto tag.
2) Pop up an HTML form where the email address and the subject is prefilled.
3) Send the email message through my site's mailserver instead of through outlook or any other mail client.
Is there a way to do this?
Thank you in advance - and once again apologies for the provocative subject line!
Cheers!
Uttam
Try it using javascript.
With using a framework like jQuery its easy so find such tags inside a frame or popup window.
You can try it by something like this:
var allATags = $('myFrameId').find('a');
$(allATags).each(function(index, element){
var href = $(element).attr('href');
//here you shall try to find out if there a mailto Link or a normal link, e.g. using regular expression or indexOf()
[...]
if (isMailToLink){
//split the href String at the signs '&' with which the subject, mail, etc is splitted and removing the mailto, putting all in own variables
[...]
$(element).attr('href', 'javascript:void(0);');
$(element).click(function(){
showMyMailForm(toMail, mailSubject, mailBody);
});
}
});
On opening a document in a frame or a popup wait for the document being loaded and then run your code to replace all existing mailto-links on that document with your mailform-mailer.
The code is just a way trying to inspire, no working code.
Users can set their default email client, here are a couple of links that may be helpful:
Firefox
Chrome
Internet Explorer
Of course this is controlled by the user, so it will help you personally, but not force others to use a specific program.
You could easily pass url parameters onto your contact landing page/email form instead of a mailto link, something like a href="http://landingpage.com/index.php?email=you#you.com&subject=hello" could be used to pre-fill generic contact/email form fields.

Win8/WinRT - How to add line breaks in email body

In my Windows 8 Store app, I have a Send Email button on a page and users are able to click it and send us an email for some general enquiries.
I need to pre-load some text in the email body but I can't seem to add line breaks to it. I tried Environment.NewLine and "\r\n". None of them works.
var mailto = new Uri("mailto:?to=james.jones#example.com&subject=Hello world&body=Hi," + Environment.NewLine + "Can you please ...");
await Windows.System.Launcher.LaunchUriAsync(mailto);
When I run it, I get "Hi,Can you please...". The line break is omitted.
Try using "%0d%0a" as your line break, as in
"Hi,%0d%0aCan you please..."
That's a URL-encoded ASCII CR/LF sequence. That works for me for the built-in Mail app but you don't have any particular guarantee that it would work for any arbitrary mail app that the user might install in the future.
The reason it doesn't work is because you're launching a Uri, Uris require that their contents be UrlEncoded / UrlEncodable. In the case of Environment.Newline etc you'd get an invalid Uri.
You can counter this by UrlEncoding the Environment Newline like this:
System.Net.WebUtility.UrlEncode(Environment.NewLine)
You maybe should consider using a Share Contract to share your content to your Mail App. Benefits: Users using your software can share it to other Apps, not only Email.

Expression Engine using the Champagne Extension troubleshooting

I have an issue in Expression Engine using the Champagne Extension where it won't allow me to send out campaigns. This extension utilizes https://www.campaignmonitor.com/ api to send out mass emails.
The Error I get is "HTML Content URL Required" when I try to send out campaigns form the back end of the Expression Engine Install.
What could be causing this issue that relates to the expression engine install?
This error is received anytime the URL to your html or text content is not visible. More often this is seen when someone forget to include the text version. A good way to test is to click the preview HTML/TEXT button and make sure both give you the correct results.
They cannot be blank.
For an alternative solution, be sure to checkout my add-on Postmaster. It allows clients to publish email campaigns just by creating a new entry. You can setup any number of configuration, so you can even send draft email to a test subscriber list. And since everything is within channel entries, you can use whatever fieldtypes you like, and it works with MailChimp as well as CampaignMonitor.
https://objectivehtml.com/articles/postmaster-the-definitive-email-solution-for-expressionengine

mailto with empty recipient?

is there anyway that I can use "mailto" with empty recipient? I only want to supply the subject and the message body and then the user can write the to addresses on mail. I tried writing only a space but it didn't work.
This should do, I tested it.
mailto:?subject=your%20subject&body=your%20body
And as HTML with correct escaping of the ampersand:
test
This should work..
test
I tried the accepted answer but it failed to launch an email when using Chrome. Using a %20 instead of a space worked though:
Send an Email