Answered by:
what mime type type to use for iphone?

Question
-
User-2146352328 posted
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.
Is it?MediaTypeNames.Text.Html?
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.
Thanks
Wednesday, March 7, 2018 5:24 PM
Answers
-
User753101303 posted
Hi,
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 ?)
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 7, 2018 6:50 PM -
User753101303 posted
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.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 7, 2018 7:26 PM -
User-2146352328 posted
OK. Fixed.
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 :)
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, March 8, 2018 9:30 AM
All replies
-
User753101303 posted
Hi,
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 ?)
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 7, 2018 6:50 PM -
User-2146352328 posted
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.
Wednesday, March 7, 2018 6:59 PM -
User753101303 posted
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).
Wednesday, March 7, 2018 7:09 PM -
User-2146352328 posted
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
).Not
AlternateView.CreateAlternateViewFromString(htmltext,
Nothing
, MediaTypeNames.Text.Html)
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?
Thanks.
Wednesday, March 7, 2018 7:16 PM -
User-2146352328 posted
I think something like this was what I was trying.Something similar:
https://notesbyparth.wordpress.com/2013/04/19/send-email-with-embedded-image-in-vb-net-or-send-image-in-email-body-through-vb-net/
Wednesday, March 7, 2018 7:17 PM -
User753101303 posted
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.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 7, 2018 7:26 PM -
User-2146352328 posted
OK.
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.
Wednesday, March 7, 2018 8:26 PM -
User-2146352328 posted
OK. Fixed.
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 :)
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, March 8, 2018 9:30 AM