Email problems

J

Jerry

I'm getting this error message. Any suggestions? Its stopping on - myMail.Send


CDO.Message.1 error '80070005'

Access is denied.

/email.asp, line 23

Sample Code:
<!--#include file="ADOvbs.inc"-->
<%Username = Cstr(Trim(Request.form("UserName")))%>
<%email = Cstr(Trim(request.form("Email")))%>
<%
Set Conn = Server.CreateObject( "ADODB.Connection" )
set oRs=Server.CreateObject("ADODB.recordset")
conn.Open "DSN=falco; uid=sa; pwd=6stang7"
strSql = "SELECT * FROM Tenant " &_
"WHERE Customerid = '" & Cstr(Request.form("UserName")) & "' " &_
"AND email = '" & Cstr(Request.form("email")) & "'"
oRS.open strSql, conn
if ors.eof then
response.redirect "errorpage.asp"
end if


Set MyMail=CreateObject("CDO.Message")
myMail.Subject="Password"
myMail.From="(e-mail address removed)"
myMail.To=ors("email")
myMail.TextBody="This is your password" &" "& ors("password")
myMail.CreateMHTMLBody "file://E:/Falco/valley.htm"
myMail.Send
Set myMail=Nothing


oRs.close
set oRS=nothing

%>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Email</title></head>

<body>


<H2>Your message has been sent!</H2>
</BODY>

</html>
 
S

Stefan B Rusynko

For tips on CDO see http://www.interlacken.com/winnt/tips/tipshow.aspx?tip=46
- but there is no way your server can send a file from your PC where you have
myMail.CreateMHTMLBody "file://E:/Falco/valley.htm"
Which should probably be: myMail.CreateMHTMLBody("valley.htm")
- if the page valley.htm is at the same level as your ASP page (if not add a relative path)



| I'm getting this error message. Any suggestions? Its stopping on - myMail.Send
|
|
| CDO.Message.1 error '80070005'
|
| Access is denied.
|
| /email.asp, line 23
|
| Sample Code:
| <!--#include file="ADOvbs.inc"-->
| <%Username = Cstr(Trim(Request.form("UserName")))%>
| <%email = Cstr(Trim(request.form("Email")))%>
| <%
| Set Conn = Server.CreateObject( "ADODB.Connection" )
| set oRs=Server.CreateObject("ADODB.recordset")
| conn.Open "DSN=falco; uid=sa; pwd=6stang7"
| strSql = "SELECT * FROM Tenant " &_
| "WHERE Customerid = '" & Cstr(Request.form("UserName")) & "' " &_
| "AND email = '" & Cstr(Request.form("email")) & "'"
| oRS.open strSql, conn
| if ors.eof then
| response.redirect "errorpage.asp"
| end if
|
|
| Set MyMail=CreateObject("CDO.Message")
| myMail.Subject="Password"
| myMail.From="(e-mail address removed)"
| myMail.To=ors("email")
| myMail.TextBody="This is your password" &" "& ors("password")
| myMail.CreateMHTMLBody "file://E:/Falco/valley.htm"
| myMail.Send
| Set myMail=Nothing
|
|
| oRs.close
| set oRS=nothing
|
| %>
|
|
| <html>
|
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| <title>Email</title></head>
|
| <body>
|
|
| <H2>Your message has been sent!</H2>
| </BODY>
|
| </html>
 
J

Jerry

Thanks for the information. I decided just to send a text message but I'm
still having the same problem with it stopping on the myMail.send. Please
Help

Set MyMail=CreateObject("CDO.Message")
myMail.Subject="Password"
myMail.From="(e-mail address removed)"
myMail.To=ors("email")
myMail.TextBody="Sample Mail"
-----> myMail.send
Set myMail=Nothing
 
K

Kevin Spencer

Hi Jerry,

Unfortunately, CDO doesn't give very good information about what went wrong.
However, this sort of error almost always happens due to the Relay
configuration of the SMTP Server that CDO is sending the message to. SMTP
Relay happens when the "from" address of the email is not specified as the
same domain as the SMTP server. In your case, the "from" address specified
"falcodevelopers.com." SMTP Servers are usually (these days) configured to
disallow Relay, as Relay is often used by SPAMmers to send SPAM. Relaying
can also be configured to allow relaying from any particular machine, group
of machines, domain, or group of domains.

Another possible issue involves the Authentication configuration of the SMTP
Server. Most SMTP Servers allow anonymous access, meaning that the SMTP
client app (CDO in your case) doesn't have to authenticate itself to the
SMTP Server. If anonymous access is disallowed, the client app must pass
credentials to the SMTP server, which can be either by Basic (plain text)
user name and password, or using Kerberos authentication. This is more
difficult to resolve. Fortunately, it is not usually the problem; Relay is.

In either case, you will need to work with the Network Administrator of the
machine hosting the SMTP server to resolve this.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
I'd rather be a hammer than a nail.
 
J

Jerry

Kevin, We have SBS 2003 and I'm the only one who works on the server. We have
three Recipient address policies. smtp.activecrane.local,
smtp.activecrane.com and smtp.falcodevelopers.com. I tried all three as
administrator but still no luck. I don't seem to understand where to go in
exchange to correct the problem. Could you put me in the right direction.
Thanks
 
K

Kevin Spencer

Hi Jerry,

I'm not a network administrator (but I do play one on tv!), and I know
enough about network administration to write network-oriented software,
including SMTP client software. As I am not a network administrator, I've
never really had much opportunity to work with Exchange Server. I did set up
a Windows 2000 domain once, about 5 years ago, on my home LAN, and set up an
Exchange Server with it, but only brushed the surface.

However, I have learned enough about Exchange to know that it is not an SMTP
server. It interoperates with SMTP servers (and POP3 servers, etc). Your
SMTP Server is hosted by Internet Information Services (IIS). I believe it
is possible to work with it through Exchange, but it probably has nothing to
do with Exchange policies, which I don't believe I mentioned in my post, and
know almost nothing about.

You should be able to work directly with the SMTP server via your IIS
snap-in. There is a help file for it. As for working with it via Exchange, I
can only recommend you check the Microsoft web site. I have created a search
for you:

http://search.microsoft.com/search/results.aspx?st=b&na=88&View=en-us&qu=Exchange+Server+SMTP

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
I'd rather be a hammer than a nail.
 
J

Jerry

Kevin, Thanks for your help. I think that I might have to add front page
extentions. I was reading that they are necessary to send email from a
website. I hope that works.

Jerry
 
K

Kevin Spencer

Kevin, Thanks for your help. I think that I might have to add front page
extentions. I was reading that they are necessary to send email from a
website. I hope that works.

Well, definitely! I assumed that you had them. Silly me!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.
 
J

Jerry

Kevin, If things could just be that easy. I installed the extensions and
added the smtp mail server, the from address and the reply address to the
extensions site. I then added a simple form and filled in the addresses to
the results tab. Still no luck. Now when I get out of the form in front page
design I get a message telling me that the email server is not configured.
I'm lost any suggestions. Thanks for your help
 
J

Jerry

Kevin, I got the form to work tonight. It is sending email just fine now.
Still don't understand why the CDO isn't working. Is there something in the
form that's not in the CDO code.
 
K

Kevin Spencer

Hi Jerry,

Sorry. I've been under the gun lately, and I was too quick on the draw. ASP
doesn't require server extensions.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.
 
J

Jerry

Kevin, I finally got it to work today. This is the code I used. Thank you for
all your help.

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "server.activecrane.local"
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "(e-mail address removed)"
.To = ors("email")
.Subject = "Falco Developers"
.TextBody = "Your Customer ID is:" &" " &ors("customerid") & vbCRLF &_
"Your password is:" &" " & ors("password")
.send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
 
K

Kevin Spencer

Nice Jerry! :-D

--

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top