Forum Moderators: open
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)
<%
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?
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