Last post Mar 08, 2018 09:30 AM by sapator
Mar 07, 2018 05:24 PM|sapator|LINK
Hi am using an alternateview and Linkedresource.
I set a the mime type in some types and everything works fine on Android. However I cannot see images on iphone.
I cannot find a clear answer googling on what type should I use.
Can anyone post a simple 3 lines example on how to use it?
I create many Linkedresource's with images and add them a mime type collection and the on the alternateview collection. Is that valid? Or do I need to do something else?Although I can see the main image, I still haven't used the peripheral images, so i'm
posting here first in order to be sure.
Mar 07, 2018 06:50 PM|PatriceSc|LINK
And the image format and mimetype you are using is ? It seems that
https://brutaldev.com/post/Sending-HTML-e-mail-with-embedded-images-(the-correct-way) works on iOS 10.
"I cannot see images on iPhone"
"I can see the main image, I still haven't used the peripheral images"
seems a bit contradictory (or you couldn't see the image, changed something to now see the image and wan't to know if what you have done is ok before proceeding further ?)
Mar 07, 2018 06:59 PM|sapator|LINK
Says,Page does not exist.
I have used text/html and there is a .net mime phone type, not on work PC right now.
When I say I can see the main image, means I can see it in everything but I phone , haven't set the other images , haven't created the appropriate LinkedResource to put(.add) To the ALTERNATEVIEW.
Mar 07, 2018 07:09 PM|PatriceSc|LINK
I fixed the link in my earlier message.
I don't understand if you are talking about the mime type for your view (likely text/plain or text/html) or for an image LinkedResource (likely image/<something> depending on what kind of image file you are using).
Mar 07, 2018 07:16 PM|sapator|LINK
I'm sorry not at the office to give the code but I believe I was using the LinkedResource by adding a mime type(MediaTypeNames).
I'm not sure exactly what I did as it was very late and I was tired. Will have a look at the link and my code tomorrow.
A question. Do I need to add both mediatype on LinkedResource and mime on alternate view? If so, the iphone correct is?
Mar 07, 2018 07:17 PM|sapator|LINK
I think something like this was what I was trying.Something similar:
Mar 07, 2018 07:26 PM|PatriceSc|LINK
MediaTypeNames.<something> just return know media or mime types (this is the same thing) ie MediaTypeNames.Text.Html should just return "text/html".
You'll have to tell the type of your views (likely text/html or text/plain) and the type of each linked resource you are using (likely image/<something>).
As you are telling an image is not shown (but the other information of the view is shown ?) my first idea is that the mime type for the image is wrong, that Android doesn't really care and "autofix" this but that iOS stops showing the image).
This is why I asked about the file format and the mime type you are using for the image that doesn't show up in iOS.
Mar 07, 2018 08:26 PM|sapator|LINK
Thank you I must see exactly what I did tomorrow and I will post If I have issues.
I'm concerned about the multiple LinkedResource's I will add to the alter view. Will see if it will turn up right.
Mar 08, 2018 09:30 AM|sapator|LINK
The main fixations are here:
Dim inlineview0 As New LinkedResource(lil(0).Location, System.Net.Mime.MediaTypeNames.Image.Jpeg)
inlineview0.ContentId = lil(0).Imagename
inlineview0.ContentType.Name = lil(0).Imagename
I have A location and imagename in a list (lil)
And on the Alternateview:
Dim myAltView As AlternateView = AlternateView.CreateAlternateViewFromString(htmldoc, New System.Net.Mime.ContentType("text/html"))
and add the LinkedResource's
Works OK :)