473,394 Members | 1,866 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,394 software developers and data experts.

CDO.Message background image

Hi - is it possible to set an image as the background body image
(non-repeating too) in a message sent using CDO. I don't want to embed an
external webpage (I have to insert user form related variables back in the
body of the email) and the image is on the server the mail is being
generated from - have googled for ages on this one but can't seem to find
anything suitable...

Thanks for any help on this.
Jul 25 '05 #1
9 7189
> Hi - is it possible to set an image as the background body image

Yes, use MHTMLBody.
http://www.aspfaq.com/2474
See "Embedding images in the e-mail"
(non-repeating too)


This is an HTML/CSS issue. You would use the same style settings as you
would in any other HTML page. Please follow up for this part of it in an
HTML/CSS newsgroup.
Jul 25 '05 #2
>> Hi - is it possible to set an image as the background body image

Yes, use MHTMLBody.
http://www.aspfaq.com/2474
See "Embedding images in the e-mail"


Well, thanks - but do I really have to embed a webpage and create further
asp code just to grab the variables I wanted to put in the email in that
seperate asp page?

Sounds like a lot more work for something that should be a couple more lines
of code! I've already html'd my code as much as I wanted to - I just wanted
now to put a background image in. I'm already using .HTMLBody - just thought
there might be a one liner to insert the background image in.

If you're saying there isn't - that's a real shame.
Jul 25 '05 #3
> Well, thanks - but do I really have to embed a webpage and create further
asp code just to grab the variables I wanted to put in the email in that
seperate asp page?


Sorry, somehow I thought you wanted to attach it without having to reference
it.

If all of the rest of your images are being referenced from online (e.g.
<img src=http://whatever>) can't you do the same for the background?

<body background=http://whatever>

And again, as for the non-repeating part, you can apply this with CSS
(off-topic here).
Jul 25 '05 #4
> Sorry, somehow I thought you wanted to attach it without having to
reference it.
That's OK - maybe I should have been clearer.
If all of the rest of your images are being referenced from online (e.g.
<img src=http://whatever>) can't you do the same for the background?

<body background=http://whatever>


No! It just doesn't work! All the other elements in the HTML work - except
for this - I have tried the http path, the C:\ path, the relative path and
none of them work! That's why I came here to post!
Jul 25 '05 #5
>> <body background=http://whatever>

No! It just doesn't work!
What about setting the background of a table, or a table cell, or using CSS
e.g. BODY { background-image:url(http://www.whatever.com/whatever.gif); })?
Please follow up in a CSS or HTML newsgroup for different ways to apply a
background image.
All the other elements in the HTML work - except for this - I have tried
the http path, the C:\ path, the relative path and none of them work!


C:\ and relative will never work if you send the e-mail anywhere... I think
it may be a mail client issue, how many different clients have you tested?
Just yours?
Jul 25 '05 #6
> What about setting the background of a table, or a table cell, or using
CSS e.g. BODY {
background-image:url(http://www.whatever.com/whatever.gif); })?
Same again! I've even tried posting the variables to a new asp page like you
suggested with CreateMHTMLBody = myURL but that doesn't work either - I get
a 500 internal server error : ( this is really getting on my nerves now. It
should be so easy.
C:\ and relative will never work if you send the e-mail anywhere... I
think it may be a mail client issue, how many different clients have you
tested? Just yours?


Yes, but as its plain old OE I'm sure 60-70% of users have it or derivatives
that work in the same way as it. Its just got to work!

Perhaps you could explain what's wrong with this code that's causing the 500
internal server error -

<%
If Request.Form("process") = "True" Then
formToName = Request.Form("to_name")
formFromName = Request.Form("from_name")
formEmailTo = Request.Form("to_email")

makeURL = "http://www.ourserver.com/thepage.asp?to_name=" & formToName &
"from_name=" & formFromName & ""
Set MyCDONTSMail = CreateObject("CDO.Message")
MyCDONTSMail.From = "ou*****@our.com"
MyCDONTSMail.To = formEmailTo
MyCDONTSMail.Subject = "ourtext"
MyCDONTSMail.CreateMHTMLBody makeURL
MyCDONTSMail.Send
Set MyCDONTSMail=nothing

End If
%>

and then in the thepage.asp:

<%
formToName = Request.querystring("to_name")
formFromName = Request.querystring("from_name")
%>

and in the body of thepage.asp

<%
formToName=Request.querystring("to_name")
Response.Write(formToName)
%>

I know its not perfect code yet as I'm still testing but this throws up
errors! Why?!

Arrghhh. Its one of those days where a little thing spiralls into a
troublesome thing.

Jul 25 '05 #7
> I get a 500 internal server error : (

(a) on which page?

(b) TURN OFF FRIENDLY ERRORS.
http://www.aspfaq.com/2109
Jul 25 '05 #8
>> I get a 500 internal server error : (

(a) on which page?


Well I wasn't sure which page it meant the error was coming from because the
application essentially inserted another asp page's generated html page into
an email - now I've switched off the friendly errors I've tracked down the
error to access is denied on the line that says:

MyCDONTSMail.CreateMHTMLBody makeURL

So I simplified the line to just go to another asp which does work, with the
same result!

Odd! ...and infuriating!
Jul 25 '05 #9
>>> I get a 500 internal server error : (

(a) on which page?


Sorry - I realised my last message might not have made sense. Basically the
problem is that this standard code
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="my****@mydomain.com"
myMail.To="so*****@somedomain.com"
myMail.CreateMHTMLBody "http://www.w3schools.com/asp/"
myMail.Send
set myMail=nothing
%>throws up the error Access is denied on the linemyMail.CreateMHTMLBody
"http://www.w3schools.com/asp/"
Jul 25 '05 #10

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

Similar topics

2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
13
by: Giggle Girl | last post by:
Hi there, I need to use a background image in a TR that does NOT restart everytime it hits a TD. Can it be done? Specifically, if you set a background image for an entier table, now mater how...
3
by: rvanvolken | last post by:
After sending an email message formatted for HTML using the STMP Mail function within .NET, my message arrives with exclamation marks throughout the text, which inadvertantly hinders the correct...
3
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in...
2
by: Patrick | last post by:
Hi All, I am trying more and more to incorporate CSS into my work here. I have currently been playing around with fluid design and tableless layout. Currently I am trying to make a background...
3
by: KNDesign | last post by:
I've set a background image to repeat-y and at 100% height. It appears fine when I open the window, but when I resize to a smaller height so that I must scroll down to see the rest, the background...
6
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
10
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
2
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.