Here's a piece of code I've used in the past to do what you're asking...
<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail"
'//these are all the images that are in this message.
'//you must include them like this.
'//please note that you DO NOT have TO write the
'//entire file path in the <IMG> tag in the body after this.
'//make sure you see the image name after the path separated by a comma
HTML = HTML & "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<TITLE>Send Mail with HTML</TITLE>"
HTML = HTML & "</HEAD>"
HTML = HTML & "<BODY bgcolor=""lightyellow"">"
HTML = HTML & "<TABLE cellpadding=""4"">"
HTML = HTML & "<TR><TH><FONT color=""darkblue"" SIZE=""4"">"
HTML = HTML & now() & " - "
HTML = HTML & "These are all great ASP Sites</FONT></TH></TR>"
HTML = HTML & "<TR><TD>"
HTML = HTML & "<A HREF=""
HTML = HTML & "<IMG SRC=""myImage2.gif""></A><BR><BR>"
HTML = HTML & "</FONT></TD></TR></TABLE><BR><BR>"
HTML = HTML & "</BODY>"
HTML = HTML & "</HTML>"
objMail.From = "rob@tconsult.com"
objMail.Subject = "Your daily HTML Mail"
'you need TO add these lines FOR the mail
'to be sent in HTML format
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = "you@yourhouse.com
objMail.Body = HTML
objMail.Send
Response.write("Mail was Sent"
set objMail = nothing
%>
T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
Thanks for the help I really appreciate it but it didn't work, I am working with a friend on this project and he said that he has tried that before and it didn't work. If you could give me any other ideas it would be great.
Well we have tried attaching the file and calling it by the image name that seems to work if the e-mail is sent to the development pc's which are on the same network as the server.
We don't want to refer the picture cause the people that get the mails aren't online the whole time and therefore wont see the picture.
I am not sure but my friend says that other code is Asp and not Asp.Net. He says that he has tried the code.
We don't get errors the image just doesn't appear.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.