Forum Moderators: open

Message Too Old, No Replies

.send Not Sending - Permissions Problem?

(help an ASP newb please)

         

lebhead

6:38 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



Hi, II am having a problem with a simple e-mail script in ASP using .send. I keep getting an error on .send that says "error encountered: Permission denied ".

Anybody have any ideas?

Thanks in advance for any help.

korkus2000

6:42 pm on Apr 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What are you using cdonts, aspemail, aspmail? Sounds like the mail server is not allowing your connection.

duckhunter

7:19 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



[edit]Now that I've thought about it, korkus is probably right. If you're getting past the CreateObject statement then it probably is the mail server[/edit]

I believe this is related to the IIS account making the call and not having rights to call the DLL.

Classic ASP: grant IUSR_<servername> permissions
.NET: grant ASPNet permissions

Depending on your answers to korkus200's questions will depend on which dll to allow (cdonts.dll or smtpsvg.dll)

lebhead

8:06 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



Thanks for the responses. I'm using CDONTS to send the e-mail. Below is the code I'm using.

<%
sender=Request.Form("sender")
recipient=Request.Form("recipient")
subj=Request.Form("subj")
message=Request.Form("message")
%>

<%set objEmail=Server.CreateObject("CDONTS.NewMail")

with objEmail
.From=sender
.To=recipient
.Subject=subj
.Body=message

On error Resume Next
.send
If Err <> 0 Then
Response.Write "error encountered: " & Err.Description
End If

End With

Set objEmail=nothing
%>

At first I just used ".send" where "On error Resume...." is. Nothing seems to work. I know the code works, because I've used it on a different server, so I'm sure you guys are right about the mail server issue. Would I have to change a permission for the IUSR_ in IIS/Windows or in my Mail Server?

Thanks again.

edit: Would it be better if I installed JMail and used that instead?

korkus2000

8:16 pm on Apr 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Honestly I don't really know how to set up permissions on a mail server. I think you will run into the same problem with jmail also. Is it your server or is it hosted by someone else? If it is someone elses box I would find out if the mail server allows anonymous connections.

duckhunter

11:09 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



I believe CDONTS requires that the local SMTP Services be running as well as permissions to relay across the mail server itself. I'm not sure either on that configuration. That's why my hosting co. requires ASPMail. You can specify your mail server across the network.

If the server you are running on cannot send mail itself, then you might look at ASPMail. Pretty easy to switch over

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "your.mail.server"

Mailer.BodyText = strBody
Mailer.Subject = "Your Subject"
Mailer.AddRecipient "John Doe","jdoe@smwhere.com"
Mailer.FromName = "Your Name"
Mailer.FromAddress= "your@email.com"

If Mailer.SendMail Then
'Success
Else
'Failed
End If

markusf

12:24 am on Apr 22, 2003 (gmt 0)

10+ Year Member



i've had this problem to, ASP.net uses different permission impersonations then ASP. So it may work in ASP but not in ASP.net You have to open up your authoritive relaying host in IIS, in the virtual mail server. For more info go to www.asp.net and search the forums for mail problems.