473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP, CDO for Windows 2000 & Embedded / In-line Images Showing as Attachments

Hello

I have been using the CDONTS.Newmail object for a number of years to send
nicely formatted HTML Emails with inline images.

I am now trying to switch over to using CDO and I cannot reproduce this
functionality. I am using the AddAttachment method instead of the old
AttachURL method but the attached images just show as separately attached
files rather than in line in the HTML.

According to MSDN:

"If you populate the HTMLBody property before calling the AddAttachment
method, any inline images are displayed as part of the message."

Well, I am doing that but it is not working. The images show up as if I had
attached them using the old AttachFile method.

Code follows.

Any help would be appreciated.

David

If bHasResults Then
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = cdoSendUsingPort
.Item(sch & "smtpserver") = "192.168.0.1"
.Update
End With
For j = 0 To iResults
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = arrResults(1, j)
.To = arrResults(2, j)
.Subject = arrResults(3, j)
If arrResults(5, j) Then ' The email has an HTML Body and may have inline
attachments
.MIMEFormatted = True
.HTMLBody = arrResults(4, j)
.AutoGenerateTextBody = True
If Not IsNull(arrResults(6, j)) Then ' It does have inline attachments
arrAttachURL = Split(arrResults(6, j), ",")
For i = 0 To UBound(arrAttachURL) Step 2
.AddAttachment arrAttachURL(i) ', arrAttachURL(i +1)
Next
End If
Else ' It's a text email
.MIMEFormatted = False
.TextBody = arrResults(4, j)
End If
.Send
objConn.Execute "DELETE FROM dbo.tblOutboundEmailQueue WHERE (EmailID = "
& arrResults(0, j) & ")", , adCmdText + adExecuteNoRecords
End With
Set cdoMessage = Nothing
Next
End If
Jul 19 '05 #1
2 4758
Here an sample section from the CDOSYS method which does not render inline:
------=_NextPart_000_0002_01C411A4.CD9131D0
Content-Type: image/gif;
name="header1.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="header1.gif"
Here is an sample section from CDONTS.Newmail that does render the image
inline:

------=_NextPart_000_0000_01C411B8.EC712830
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Disposition: attachment
Content-Location: header1.gif

I can't see why these would make a difference. The only real difference is
that the super doopa CDO method does not add the Content-Location field.
Jul 19 '05 #2
I was using the wrong method, sorry if you had started to research this for
me.

Documentation here - http://tinyurl.com/2rcf6
"David Morgan" <da***@davidmorgan.me.uk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Here an sample section from the CDOSYS method which does not render inline:

------=_NextPart_000_0002_01C411A4.CD9131D0
Content-Type: image/gif;
name="header1.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="header1.gif"
Here is an sample section from CDONTS.Newmail that does render the image
inline:

------=_NextPart_000_0000_01C411B8.EC712830
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Disposition: attachment
Content-Location: header1.gif

I can't see why these would make a difference. The only real difference is that the super doopa CDO method does not add the Content-Location field.

Jul 19 '05 #3

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

Similar topics

0
by: kelly ko | last post by:
I am a VB Dot.net developer. If I want to run my application that was built on Windows 2000 platform on a machine that is build with Windows Embedded XP, Will it run? Do I need to put the...
1
by: Justin Kozuch | last post by:
Hi All, How do I determine the path to Perl on a Windows 2000 server? My hosting company has installed ActiveState Perl (latest version). I've called them and they said the path to perl is...
6
by: Belinda | last post by:
Hello All I want to install the NT 4.0 Option pack to install the IIS web server. Does the option pack install to get the web server working on my Windows NT workstation running SP6a work. I...
10
by: Jesper | last post by:
Does anyone know some c++ code for shutting down windows? I want to write a program using borland c++ builder to shut down windows. --
9
by: Eunice Santorini | last post by:
Every once in a while (especially when I visit suspect web sites :), every single window on my Microsoft Windows XP & Microsoft Windows 2000 operating systems goes haywire. All the windows...
0
by: Nick White [MSFT] | last post by:
Hello fellow Microsoft Windows Mobile and Embedded enthusiasts: I invite you to peruse the list below of upcoming technical chats and Webcasts offered by the Windows Mobile and Embedded Devices...
2
by: Alfredo Magallón Arbizu | last post by:
Hello, I have an ASP.NET application that reads an Excel file through automation. The app has a loop until first cell of a row is blank. While the app works perfectly under Windows 2003, it...
0
by: meetsri2003 | last post by:
Hi all ! I was using unixodbc for connecting to ms sql server on linux it is working fine,but now i want to check ms sql server compatible embedded sql c library on linux. what is ms sql server...
42
by: coder_lol | last post by:
Thanks everyone again for contributing to helping me clear C++ confusions. I did some serious reading on copy constructors and assignments and I think I've got a good handle on the memory stuff. ...
3
by: David | last post by:
Hi Has anyone experienced any problems with embedded charts on forms when running windows vista? I'm running Access 2000 (old I know) and have noticed that embedded charts don't appear, unless...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.