Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Error Access denied while sending mail

Status
Not open for further replies.

lokesh123

Programmer
Jun 14, 2001
21
US
Hi,
I am trying to send mail thru the ASP code with VBscript on IIS web server from my web page. but I am getting Error:Access is Denied.
Can someone tell me what could be the problem.

Thanks

I am trying to run the following ASP code which is called from another html page:

<%@ Language=VBScript %>

<%
'Send using the Pickup directory on the IIS server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1

set iMsg = CreateObject(&quot;CDO.Message&quot;)
set iConf = CreateObject(&quot;CDO.Configuration&quot;)

' set the CDOSYS configuration fields to use the SMTP service pickup directory
Set Flds = iConf.Fields
With Flds
.Item(&quot; = cdoSendUsingPickup
.Item(&quot; = &quot;c:\inetpub\mailroot\pickup&quot;
.Update
End With

' build HTML for message body
strHTML = &quot;<HTML>&quot;
strHTML = strHTML & &quot;<HEAD>&quot;
strHTML = strHTML & &quot;<BODY>&quot;
strHTML = strHTML & &quot;<b> This is the test HTML message body</b></br>&quot;
strHTML = strHTML & &quot;</BODY>&quot;
strHTML = strHTML & &quot;</HTML>&quot;

' apply settings to the message
With iMsg
Set .Configuration = iConf
.To = &quot;user@mydomain.com&quot;
.From = &quot;admin@mydomain.com&quot;
.Subject = &quot;This is a test CDOSYS message (Pickup directory)&quot;
.HTMLBody = strHTML
.Send
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing


%>
 
Server.CreateObject(&quot;CDO.Message&quot;)

but I dont think thats the cause. Is CDO installed properly? (dll registered etc.)

_____________________________________________________________________
onpnt2.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top