473,748 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How does Outlook embed pictures in emails??

Siv
Hi,

I have written an application which is used by sales staff when discussing
products with their customers over the phone. It is a database application
that holds detailed information about their products including pictures to
assist the sales staff describe features to the customer. The next step in
development of the app is to have a button when in a particular product
screen that the seller can press which sends the customer an email with the
picture embedded in an HTML format Outlook message. I have got it to work
superbly, the email is constructed by the application and sent to the outbox
ready for send and receive and looks fine. When the mail is sent however, I
find that the picture is replace by a place holder "X" symbol indicating the
picture was not found.

My initial thoughts were that I hadn't got the "Send Pictures from the
Internet" option ticked, but even when it is, the picture is still missing.

When I look at an email sent to me from someone where the picture was
inserted into the body text of the message, the image is not mentioned as a
link in normal "img" style format it looks like this:

<DIV>
<FONT face=Arial size=2>
<SPAN class=866055209-20072005>
<IMG alt=chesham hspace=0 src="cid:866055 209@20072005-2abd" align=baseline
border=0>
</SPAN>
</FONT>
</DIV>

Does anyone know how you can do this programmaticall y as I suspect if I just
copy the above HTML code it won't work as the "cid:866055209@ 20072005-2abd"
is probably specific to the individual instance of the picture sent to me,
it is clearly constructed using the date (UK format). I really need to
understand how Outlook constructs that code and embeds the picture and
indeed if there is a process I can call programmaticall y that does the
erquivalent of a user embedding the picture manually.

I currently do the following in code:
I have some declarations at the top of the class module:

Private OApp As Outlook.Applica tion
Private email As Outlook.MailIte m
Private oNameSpace As Outlook._NameSp ace
Private oOutboxFolder As Outlook.MAPIFol der

Then in the subroutine that hangs off a small form that allows the user to
enter the adressee's email and message subject line I have (removed try
catch block and error checking for simplicity):

Dim EmailAddress, ToAddress, BodyHTML, Salutation As String

EmailAddress = txtEmail.Text
Salutation = txtSalutation.T ext

OApp = New Outlook.Applica tion
oNameSpace = OApp.GetNamespa ce("MAPI")
oNameSpace.Logo n("outlook", "", False, False)
oOutboxFolder =
oNameSpace.GetD efaultFolder(Ou tlook.OlDefault Folders.olFolde rOutbox)

... here I construct a string called BodyHTML which is just the
HTML code for the message body ..

email = OApp.CreateItem (OlItemType.olM ailItem)
email.To = EmailAddress
email.Subject = "Details of the Item you requested."
email.HTMLBody = BodyHTML
email.Send()

I need to find out how to build the HTML string so that the picture is
embedded not left behind on the user's PC.

Thanks for any help.

--
Siv
Martley, Near Worcester, UK.
Nov 21 '05 #1
2 14401
Siv,
Here is an example (requires CDO or Redemption) to add an embedded image
file to a message.

http://www.outlookcode.com/d/code/htmlimg.htm

Hope this helps
Jay

"Siv" <ms**********@r emoveme.sivill. com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
| Hi,
|
| I have written an application which is used by sales staff when discussing
| products with their customers over the phone. It is a database
application
| that holds detailed information about their products including pictures to
| assist the sales staff describe features to the customer. The next step
in
| development of the app is to have a button when in a particular product
| screen that the seller can press which sends the customer an email with
the
| picture embedded in an HTML format Outlook message. I have got it to work
| superbly, the email is constructed by the application and sent to the
outbox
| ready for send and receive and looks fine. When the mail is sent however,
I
| find that the picture is replace by a place holder "X" symbol indicating
the
| picture was not found.
|
| My initial thoughts were that I hadn't got the "Send Pictures from the
| Internet" option ticked, but even when it is, the picture is still
missing.
|
| When I look at an email sent to me from someone where the picture was
| inserted into the body text of the message, the image is not mentioned as
a
| link in normal "img" style format it looks like this:
|
| <DIV>
| <FONT face=Arial size=2>
| <SPAN class=866055209-20072005>
| <IMG alt=chesham hspace=0 src="cid:866055 209@20072005-2abd" align=baseline
| border=0>
| </SPAN>
| </FONT>
| </DIV>
|
| Does anyone know how you can do this programmaticall y as I suspect if I
just
| copy the above HTML code it won't work as the
"cid:866055209@ 20072005-2abd"
| is probably specific to the individual instance of the picture sent to me,
| it is clearly constructed using the date (UK format). I really need to
| understand how Outlook constructs that code and embeds the picture and
| indeed if there is a process I can call programmaticall y that does the
| erquivalent of a user embedding the picture manually.
|
| I currently do the following in code:
| I have some declarations at the top of the class module:
|
| Private OApp As Outlook.Applica tion
| Private email As Outlook.MailIte m
| Private oNameSpace As Outlook._NameSp ace
| Private oOutboxFolder As Outlook.MAPIFol der
|
| Then in the subroutine that hangs off a small form that allows the user
to
| enter the adressee's email and message subject line I have (removed try
| catch block and error checking for simplicity):
|
| Dim EmailAddress, ToAddress, BodyHTML, Salutation As String
|
| EmailAddress = txtEmail.Text
| Salutation = txtSalutation.T ext
|
| OApp = New Outlook.Applica tion
| oNameSpace = OApp.GetNamespa ce("MAPI")
| oNameSpace.Logo n("outlook", "", False, False)
| oOutboxFolder =
| oNameSpace.GetD efaultFolder(Ou tlook.OlDefault Folders.olFolde rOutbox)
|
| ... here I construct a string called BodyHTML which is just the
| HTML code for the message body ..
|
| email = OApp.CreateItem (OlItemType.olM ailItem)
| email.To = EmailAddress
| email.Subject = "Details of the Item you requested."
| email.HTMLBody = BodyHTML
| email.Send()
|
| I need to find out how to build the HTML string so that the picture is
| embedded not left behind on the user's PC.
|
| Thanks for any help.
|
| --
| Siv
| Martley, Near Worcester, UK.
|
|
Nov 21 '05 #2
Siv
Jay,
Many thanks for this, I will pour over it and see if I can a) get my head
round it and b) implement it. Initial look seems to be exactly what I need.
Thanks again.
--
Siv
Martley, Near Worcester, UK.
"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:eR******** ******@TK2MSFTN GP10.phx.gbl...
Siv,
Here is an example (requires CDO or Redemption) to add an embedded image
file to a message.

http://www.outlookcode.com/d/code/htmlimg.htm

Hope this helps
Jay

"Siv" <ms**********@r emoveme.sivill. com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
| Hi,
|
| I have written an application which is used by sales staff when
discussing
| products with their customers over the phone. It is a database
application
| that holds detailed information about their products including pictures
to
| assist the sales staff describe features to the customer. The next step
in
| development of the app is to have a button when in a particular product
| screen that the seller can press which sends the customer an email with
the
| picture embedded in an HTML format Outlook message. I have got it to
work
| superbly, the email is constructed by the application and sent to the
outbox
| ready for send and receive and looks fine. When the mail is sent
however,
I
| find that the picture is replace by a place holder "X" symbol indicating
the
| picture was not found.
|
| My initial thoughts were that I hadn't got the "Send Pictures from the
| Internet" option ticked, but even when it is, the picture is still
missing.
|
| When I look at an email sent to me from someone where the picture was
| inserted into the body text of the message, the image is not mentioned
as
a
| link in normal "img" style format it looks like this:
|
| <DIV>
| <FONT face=Arial size=2>
| <SPAN class=866055209-20072005>
| <IMG alt=chesham hspace=0 src="cid:866055 209@20072005-2abd"
align=baseline
| border=0>
| </SPAN>
| </FONT>
| </DIV>
|
| Does anyone know how you can do this programmaticall y as I suspect if I
just
| copy the above HTML code it won't work as the
"cid:866055209@ 20072005-2abd"
| is probably specific to the individual instance of the picture sent to
me,
| it is clearly constructed using the date (UK format). I really need to
| understand how Outlook constructs that code and embeds the picture and
| indeed if there is a process I can call programmaticall y that does the
| erquivalent of a user embedding the picture manually.
|
| I currently do the following in code:
| I have some declarations at the top of the class module:
|
| Private OApp As Outlook.Applica tion
| Private email As Outlook.MailIte m
| Private oNameSpace As Outlook._NameSp ace
| Private oOutboxFolder As Outlook.MAPIFol der
|
| Then in the subroutine that hangs off a small form that allows the user
to
| enter the adressee's email and message subject line I have (removed try
| catch block and error checking for simplicity):
|
| Dim EmailAddress, ToAddress, BodyHTML, Salutation As String
|
| EmailAddress = txtEmail.Text
| Salutation = txtSalutation.T ext
|
| OApp = New Outlook.Applica tion
| oNameSpace = OApp.GetNamespa ce("MAPI")
| oNameSpace.Logo n("outlook", "", False, False)
| oOutboxFolder =
| oNameSpace.GetD efaultFolder(Ou tlook.OlDefault Folders.olFolde rOutbox)
|
| ... here I construct a string called BodyHTML which is just
the
| HTML code for the message body ..
|
| email = OApp.CreateItem (OlItemType.olM ailItem)
| email.To = EmailAddress
| email.Subject = "Details of the Item you requested."
| email.HTMLBody = BodyHTML
| email.Send()
|
| I need to find out how to build the HTML string so that the picture is
| embedded not left behind on the user's PC.
|
| Thanks for any help.
|
| --
| Siv
| Martley, Near Worcester, UK.
|
|

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4313
by: Bob | last post by:
Hi Everybody A tough one!!! Is there any way that incoming eMails (MailItems) into Ms Outlook can be used to automatically create records in a ms Access table or sub table. Smiley Bob
3
1920
by: Curious George the Monkey | last post by:
Hi, I have about 20,000 emails of which about 1% of them have attached word, excel, jpeg, pdf, powerpoint files. The emails are located in about 1000 folders. The hierachy of folders is maximum of 5 deep starting at the INBOX. So.... the problem is that Outlook is running too slow now and I have to figure out how I can organize these messages
3
2366
by: Strasser | last post by:
In Access2000 mass emailing worked perfectly (very powerful tool!). Doesn't work when using XP version of both Access and Outlook, even though I checked the box to ensure that I was sending the email. Any ideas? Thanks in advance.
3
2853
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a button to display the picture in a pop-up window and also another button to email the potential...
1
7061
by: PhilD | last post by:
My C#.NET console app checks a public folder every 24 hours for incoming emails. For each unread email in the folder, it copies any attachments to the network, then loads the contents of these files into a SQL Server database, and marks the email as read. My problem is that in the loop that checks for all the Unread emails in the folder, as I spin through the loop, the number of unread items is being reset for every iteration. So...
16
6199
by: Kosmos | last post by:
Good afternoon everyone, just wondering if anyone knew if it's possible to send meetings or appointments through email when you run VBA or SQL code in Access 2003? The following is the code I've been using which sends If you want to see the above code in its full context you can see it here: http://www.thescripts.com/forum/thread581521.html Willakawill helped me out a bit with getting access to remember if it had already added the...
6
4757
by: AMP | last post by:
I am trying to write a windows sevice that will send emails. The data is stored in a database and the service scans the database for new entries It work well as a stardard windows app, but when you make is a service it all works except it will not sent the emails Attached is the public sub that should run, its the same code that in the stardard winform, both app's are using Threads
4
6993
by: ldynrd49 | last post by:
I am using Outlook Express 6.0 and lately have received some emails with photos or images that do not attach or show in the email. There is a box where the image should be an da smal box with a red x in the far uppr left hand corner. I've tried the "open picture" with the right mouse button, but that doesn't work. Not all the emails come in like this though. I've researched this with friends, but we're at a quandry as to why this is...
6
1985
by: =?Utf-8?B?UmljaA==?= | last post by:
How to suppress the Outlook 2003 security prompts from VB2005. When I tried to look at the body of a message or any other part of an outlook mailItem -- I get these annoying security prompts. I have to loop through several emails a day. Is there some code for suppressing this? I saw some articles about a product called Outlook Redemption which supposed suppresses these messages. I have not tried it. Anyone know how to use it? ...
0
8983
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8822
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.