Click to See Complete Forum and Search --> : asp+html email
jrthor2
03-24-2007, 02:46 PM
I have an application that I am sending out html emails. Is there a way to do include files in an email? For example, in my website, I use:
<!--#include virtual="/inc/footer.asp"-->
to include my footer, header, etc. I'd like to put a footer and header on my emails the same way, but was wondering if I could use an include of somekind so that if I have other applications that send out emails, I could use the same include file so if I made a change to the email footer, I wouldn't have to update all my different email code, just the include file?
Thanks!
jrthor2
03-25-2007, 03:27 PM
Ok, I've been looking at getting this to work all weekend. I an using CDO, and I read about sending an html email that sends a web page, so I tried to implement it. I have my code that generates the email, that looks like this:
Set objMail = Server.CreateObject("CDO.Message")
'Set key properties
objMail.From = sName & "<" & sFrom & ">"
objMail.To = sTo
objMail.Subject= sSubject
'send email from webpage
objMail.CreateMHTMLBody "http://www.site.com/online_store/downloadable/download.asp?pin=" & pin
'Send the email
objMail.Send
'Clean-up mail object
Set objMail = Nothing
When It tries to send the mail, I get this error:
CDO.Message.1 error '800c0005'
The system cannot locate the resource specified.
Which points to the line that has objMail.CreateMHTMLBody "http://www.site.com/online_store/downloadable/download.asp?pin=" & pin
The file is there on the server, so I'm not sure why it says it cannot locate the resource specified??
Thanks
jrthor2
03-27-2007, 09:55 AM
can anyone help here?
jrthor2
03-29-2007, 02:18 PM
anyone, please????
buntine
03-29-2007, 09:27 PM
I assume the parameter expects a local file apposed to a remote one. Try a physical path on your server.
Andrew.
jrthor2
03-30-2007, 05:52 AM
actually, I have tried using 127.0.0.1 and localhost, but that didn't work.
jrthor2
03-30-2007, 09:06 AM
I have tried this as well (I got the path using the Server.MapPath):
\\shared.hosting.local\nfs\cust\1\86\18\681681\web\online_store\downloadable\download.asp
No luck though.
Chikara
03-30-2007, 03:18 PM
what is www.mysite.com?
If you are running a webserver that doesn't have a domain(www.somehost.com) type in your ip. If you are just testing things out at your home pc try the following. You can get your ip by going doing this.
Start -> run
cmd
ipconfig
http://123.22.22.11/something/page.asp
or your localhost.
http://127.0.0.1/something/page.asp
jrthor2
04-03-2007, 05:55 AM
www.mysite.com would be my website address. I am not running my own webserver. I'm trying to send a dynamic email that gets the contents from a page on my site.