Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-23-2007, 10:51 PM   PM User | #1
afranka
New Coder

 
Join Date: Jul 2002
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
afranka is an unknown quantity at this point
Problem using CDO.Message

Hi,

I am using CDO.Message and everything is running fine until I try to add an attachment. I think that the problem is that the webserver running this code does not have permission to the resource where the attachment is stored, even though the users attempting to use this do!

You can see that I am not permissions expert!
IIS is set to Windows Authentication, no anonymous.

Code:

<%
Dim objMail
Dim strSubject
Dim strBody
strSubject = "test"
strBody = "Blah!"
Set objMail = CreateObject("CDO.Message")
objMail.From = "test@testing.com"
objMail.To= "test@testing.com"
objMail.ReplyTo = "test@testing.com"
objMail.Subject = strSubject
objMail.TextBody = strBody
objMail.AddAttachment = "\\server\Files\test.doc"
objMail.Send
Set objMail = Nothing
%>

For example, I can access \\server\Files\test.doc directly but cannot run this code without an Access Denied error... Just to clarify, If I set the attachment to be a file on the webserver, it works fine.

Please can someone help me?
Thanks!

alex.
afranka is offline   Reply With Quote
Old 05-24-2007, 12:26 PM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
Umm. I'm not an expert on network drives (or anything else for that matter), but... shouldn't that path start with a drive letter?
Spudhead is offline   Reply With Quote
Old 05-24-2007, 12:52 PM   PM User | #3
afranka
New Coder

 
Join Date: Jul 2002
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
afranka is an unknown quantity at this point
Hi SpudHead!

Thanks for responding,
Using a UNC path instead of a mapping seems to work fine.

I have been playing with this this morning and have switched to using C# to do it so that I can use 'identity impersonation' via the web.config file. I have found a couple of other ways to do it but this does the trick!

Cheers,
a.
afranka is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:31 PM.


Advertisement
Log in to turn off these ads.