I need to add some URLS to pdfs inside my email body
Outlook can create clickable (ctrl+right click) links inside the body. The problem is that if I have spaces in the pdf name the URL breaks.
Here is the html generated in my app. The problem is only with the Spaces inside url. I was trying to replace URLs spaces server side with '%20' but this also didn't help.
<a href="mailto:;somemail@gmail.com;?Subject=SomeSubject&body=http://someUrl/File%20name%202015-05-21%2011-21-08.pdf%0D%0A%0D%0A" title="title" class="btn">Send email</a>
Clickable URL will break on the first space:
http://someUrl/File...
Is there anyway to encode urls so outlook will create proper links inside the body ?
Cheers!
You can't have spaces in URLs so you must encode the space in the filename in order to create a URL to the file.
mailto:
URLs are URLs so an encoded space will be converted back to a regular space when it is parsed. When inserting one URL into an other, you must encode all the special characters in the nested URL (i.e. you need to convert the %
characters to %25
).