Are you a Google Analytics enthusiast?
More SEO Content
Reg Sending Email
Posted 17 September 2008 - 08:43 AM
The code is
mailobj.AddAttachment "http://www.anysite.c...news/news.html" is working fine
but suppose I have to attach the file stored in the folder news dynamically based on imput from form it shows error as unable to locate file
I tried something like:
mailobj.AddAttachment "http://www.anysite.com/news/" & thefilenameVar
but shows error in that line. Plz help as I am new to ASP and coding.
Posted 17 September 2008 - 09:01 AM
Also would the path to a file ASP is trying to attach be a file path not a URL ?
that's what it would be if I was using perl to attach a file to an email.
Edited by 1dmf, 17 September 2008 - 09:09 AM.
Posted 17 September 2008 - 10:52 AM
You're running the mail script from www.mysite.com/sendmail.asp
The file you want to attach is in www.mysite.com/news/ [any file name]
To attach it I think you need to do the following:
But, as 1DMF says, you may need to check that the file name is being passed correctly to your variable to do this, above the line that's giving you the error put:
That will write out what's in your variable and stop the script from executing so you can have a look at it.
Posted 18 September 2008 - 06:14 AM
.AddAttachment Server.MapPath(".") & "\news\" & theFileName.
It worked both in local and online.
Posted 18 September 2008 - 06:31 AM
forward slash vs backslash?
Posted 18 September 2008 - 06:34 AM
After 15 years you would have thought I'd remember by now
Posted 18 September 2008 - 07:30 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users