B
bitstream
So, I have an application which hooks the MailItem Send event in
Outlook and wraps the message in a template automagically. The product
is basically a way to wrap your emails in a template that appears like
your company letterhead, but with the nice features of HTML added to it
such as linking to specific bits of information on the customers
website. When they send the message to their customers, they have one
nice email with important links and contact information wrapped around
the message body.
In Outlook 2000, XP and 2003 this works flawlessly. In Outlook 2007,
not so much.
The product inserts links to images and wraps them in a server side
image map (ISMAP). This accomplishes two things for the product. The
image maps allow us to link to specific portions of the customers
website rather than one location. Also, by linking to the images when
the customer updates there templates with new images or changed
information after the cached images expire in Outlook, the emails get
the changed images/new information.
Generally speaking the images contain user specific information, such
as the users name, phone numbers, title, address, ect. The image maps
for these business card type images contain a default link to the vcard
for the user, as well as special links for maps to the users location,
or in many cases biographies or references specific to the user sending
the message.
All of this is done via remote linking rather than embedding images to
keep the message small and facilitate the dynamic republishing aspect.
Well, in Outlook 2007, when I insert the HTML into the message by
setting HTMLBody, the image link is replaced with an image attachment.
The image is resized/recreated, its not even the original image.
Images which were originally linked as GIFs become JPEGs or PNGs of
32x32 pixels in size.
Also in the process, the image map attribute of the image link is
removed making any click on the image go to the default link which is
wrapped around the image.
In my debugging I've found that the images can be prevented from
shrinking by adding the proper width/height attributes to the img
reference. The images are still recreated as a different file type and
attached to the message rather than being left as a link, but atleast
they look right.
Also during this process no matter what HTML I place in HTMLBody,
Outlook replaces it with Wordy html. Sending an html message with only
the word 'test' in a 20KB message body for the HTML section alone. I
know this isn't a lot in the grand scheme of things, and disk space is
cheap, but thats not the point.
Can anyone provide me with some way to prevent Outlook from mangling
what I set the HTMLBody to?
I've created an example app to make sure I'm not doing anything else
silly that would cause this to occur, so either MS has decided no one
else knows how to make HTML that will work in email clients, or I'm not
setting something.
I've tried setting the HTMLBody to w3c validated HTML, I've tried
wrapping the HTML in the same fluff that Outlook puts in when you
compose a message thinking maybe it wanted to see some specific styles
or tags, neither of this things made a difference.
The following code is what I use in my example COM Addon to test the
problem. I've tried it in the ItemSend event, as well as both the Save
and Write events of MailItem, all produce the same results, atleast its
consistent. The following is my MailItem send event handler
Private Sub objMailItem_Send(Cancel As Boolean)
objMailItem.HTMLBody = "<a
href=""http://mm1.lettermark.net/rtsz/lhead/news_rtsz.map""
name=""f7hmap""><img width=""600"" height=""78""
src=""http://mm1.lettermark.net/rtsz/lhead/news_rtsz.gif""
name=""f7img"" ISMAP></a><br/>Header Image"
End Sub
The Addon is created using VB6 due to the legacy nature of the existing
code base I must maintain.
On a side note, it appears that even though Microsoft claims the img
tag supports ISMAP, when I view messages sent from other email clients
which send without modifing my message, it always goes to the default
link completely ignoring the ISMAP in Outlook2007. Has anyone seen
Outlook 2007 work with ISMAPs? Or for that matter client side maps?
And for the recorded, I'd be perfectly happy if someone told me that
our image maps are screwed up or the HTML is missing something mind
numbingly obvious that other clients just happen to work around as long
as I can make it work in Outlook 2007.
David
Outlook and wraps the message in a template automagically. The product
is basically a way to wrap your emails in a template that appears like
your company letterhead, but with the nice features of HTML added to it
such as linking to specific bits of information on the customers
website. When they send the message to their customers, they have one
nice email with important links and contact information wrapped around
the message body.
In Outlook 2000, XP and 2003 this works flawlessly. In Outlook 2007,
not so much.
The product inserts links to images and wraps them in a server side
image map (ISMAP). This accomplishes two things for the product. The
image maps allow us to link to specific portions of the customers
website rather than one location. Also, by linking to the images when
the customer updates there templates with new images or changed
information after the cached images expire in Outlook, the emails get
the changed images/new information.
Generally speaking the images contain user specific information, such
as the users name, phone numbers, title, address, ect. The image maps
for these business card type images contain a default link to the vcard
for the user, as well as special links for maps to the users location,
or in many cases biographies or references specific to the user sending
the message.
All of this is done via remote linking rather than embedding images to
keep the message small and facilitate the dynamic republishing aspect.
Well, in Outlook 2007, when I insert the HTML into the message by
setting HTMLBody, the image link is replaced with an image attachment.
The image is resized/recreated, its not even the original image.
Images which were originally linked as GIFs become JPEGs or PNGs of
32x32 pixels in size.
Also in the process, the image map attribute of the image link is
removed making any click on the image go to the default link which is
wrapped around the image.
In my debugging I've found that the images can be prevented from
shrinking by adding the proper width/height attributes to the img
reference. The images are still recreated as a different file type and
attached to the message rather than being left as a link, but atleast
they look right.
Also during this process no matter what HTML I place in HTMLBody,
Outlook replaces it with Wordy html. Sending an html message with only
the word 'test' in a 20KB message body for the HTML section alone. I
know this isn't a lot in the grand scheme of things, and disk space is
cheap, but thats not the point.
Can anyone provide me with some way to prevent Outlook from mangling
what I set the HTMLBody to?
I've created an example app to make sure I'm not doing anything else
silly that would cause this to occur, so either MS has decided no one
else knows how to make HTML that will work in email clients, or I'm not
setting something.
I've tried setting the HTMLBody to w3c validated HTML, I've tried
wrapping the HTML in the same fluff that Outlook puts in when you
compose a message thinking maybe it wanted to see some specific styles
or tags, neither of this things made a difference.
The following code is what I use in my example COM Addon to test the
problem. I've tried it in the ItemSend event, as well as both the Save
and Write events of MailItem, all produce the same results, atleast its
consistent. The following is my MailItem send event handler
Private Sub objMailItem_Send(Cancel As Boolean)
objMailItem.HTMLBody = "<a
href=""http://mm1.lettermark.net/rtsz/lhead/news_rtsz.map""
name=""f7hmap""><img width=""600"" height=""78""
src=""http://mm1.lettermark.net/rtsz/lhead/news_rtsz.gif""
name=""f7img"" ISMAP></a><br/>Header Image"
End Sub
The Addon is created using VB6 due to the legacy nature of the existing
code base I must maintain.
On a side note, it appears that even though Microsoft claims the img
tag supports ISMAP, when I view messages sent from other email clients
which send without modifing my message, it always goes to the default
link completely ignoring the ISMAP in Outlook2007. Has anyone seen
Outlook 2007 work with ISMAPs? Or for that matter client side maps?
And for the recorded, I'd be perfectly happy if someone told me that
our image maps are screwed up or the HTML is missing something mind
numbingly obvious that other clients just happen to work around as long
as I can make it work in Outlook 2007.
David