Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2005, 12:18 PM
Authorized User
 
Join Date: Sep 2004
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default CDONTS: contentLocation--trouble working

Good afternoon.

I've written a web-based e-mail system that's working fine.

What i would like to do now is add images to my e-mails.

here's the code that i use to embed images in my e-mail: <img height="399" alt="" src="../ewebeditpro4/upload/joebwrco.jpg" width="600" border="0" />

I'm trying to use content location to specify the base url for the image file: objEmail.ContentLocation = "http://www.cshgreenwich.org".

However, this is not working. Any idea as to what i'm doing wrong?

thanks for your help.

btw, the only time that an image is successfully displayed in an e-mail is when i hard-code the entire url, like this: <img height="399" alt="" src="http://www.cshgreenwich.org/ewebeditpro4/upload/joebwrco.jpg" width="600" border="0" />


================================================== ==================

here's the asp code that i use to send the e-mail:

set objEmail = server.CreateObject("CDONTS.NewMail")

objEmail.To = session("sesEmailTo")
objEmail.From = session("sesEmailFrom")
objEmail.CC = session("sesEmailCC")
objEmail.BCC = session("sesEmailBCC")
objEmail.value("Reply-To") = session("sesEmailReply")
objEmail.Subject = session("sesEmailSubject")


strHTMLemailBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
strHTMLemailBody = strHTMLemailBody & "<html>"
strHTMLemailBody = strHTMLemailBody & "<head>"
strHTMLemailBody = strHTMLemailBody & "<meta http-equiv=""Content-Type"""
strHTMLemailBody = strHTMLemailBody & "content=""text/html; charset=iso-8859-1"">"
strHTMLemailBody = strHTMLemailBody & "<title>Convent of the Sacred Heart</title>"
strHTMLemailBody = strHTMLemailBody & "</head>"
strHTMLemailBody = strHTMLemailBody & "<body>"
strHTMLemailBody = strHTMLemailBody & session("sesEmailBody")
strHTMLemailBody = strHTMLemailBody & "</body>"
strHTMLemailBody = strHTMLemailBody & "</html>"

objEmail.Body = strHTMLemailBody
objEmail.BodyFormat = 0
objEmail.MailFormat = 0
objEmail.ContentLocation = "http://www.cshgreenwich.org"

objEmail.send
set objEmail = nothing



 
Old May 11th, 2005, 09:47 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubhav.kumar
Default

Hi dear,

have you set ContentBase property instead of contentLocation?

Anubhav Kumar
 
Old May 12th, 2005, 02:15 PM
Authorized User
 
Join Date: Sep 2004
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default

thanks for checking my posting.

yes. i've tried just objEmail.ContentLocation = "http://www.cshgreenwich.org", just objEmail.ContentBase = "http://www.cshgreenwich.org" and finally both, but none seem to work.

any thoughts?

thank you.

sal




 
Old May 12th, 2005, 03:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sal,

It works. I am able to see the guy's pic coming through, I just copy/pasted your code and that seems working fine. It also works with "ContentBase".

What is that you see?

_________________________
- Vijay G
Strive for Perfection
 
Old May 19th, 2005, 12:06 PM
Authorized User
 
Join Date: Sep 2004
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default

that's great news.

yes, if you use this code it will work: <img height="399" alt="" src="http://www.cshgreenwich.org/ewebeditpro4/upload/joebwrco.jpg" width="600" border="0" />

since the url is hard-coded and absolute.

however, were you able to get it to work w/ the relative url?

please send me the e-mail: [email protected]

thank you.

sal






Similar Threads
Thread Thread Starter Forum Replies Last Post
using CDONTS maunishq ASP.NET 1.0 and 1.1 Basics 1 August 23rd, 2007 09:35 AM
CDONTS sendmail stops working suddenly Cinderella Classic ASP Basics 1 March 9th, 2006 08:45 PM
cdonts p2ptolu Classic ASP Databases 1 March 8th, 2005 11:48 AM
CDONTS preeti Wrox Book Feedback 1 August 11th, 2004 09:39 AM
CDONTS asims12 Classic ASP Basics 1 November 13th, 2003 10:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.