I have a view (with one or more images) that I also want to use as the body of an email message. The Model serving the view uses Url.Content()
to retrieve the absolute image path. This approach works fine for web pages, but when I render the exact same view as the body of the email, then the image can not be found which is suggested by the incomplete path from the rendered html.
<img src="/Media/fe882a1d-3b77-4264-ab91-cade985ecbed.JPG"/>
I know that this problem can be fixed if I could access the full url such as with Url.Action
with the
Request.Url.Scheme
overload for protocol. Is there a way to determine the fully qualified URL from Url.Content
?