Solved

I have a problem Using CDO object to send Online E-mails...

Posted on 2003-12-09
13
332 Views
Last Modified: 2012-05-07
Hi everyone,
Well I use this source code to send an E-mail :

<%@LANGUAGE="VBSCRIPT" %>
<%

        Dim subject , email
        Dim objCDO

       
         Body = "<table>"
        Body = Body & "<tr><td> Sending E-mail !!!</td></tr>"
               
         Set objCDO = Server.CreateObject("CDONTS.Newmail")

        objCDO.From = "Sender@myserver.com"
        objCDO.To = "Receiver@myserver.com"
        objCDO.Subject = " Hi  "
        objCDO.Body = Body
        objCDO.BodyFormat = 0
        objCDO.MailFormat = 0
       
         objCDO.Send
             
             set objCDO = nothing
             
%>
<html>
<body>
Mail Sent!!!
</body>
</Html>



but I receive "HTTP 500 - internal server error"  ,  and I don't know what's the problem.
Please Help me in this Case, I need it so so much.
thanks for your Help,
regards,
Sam
0
Comment
Question by:shocking_ASP
  • 4
  • 3
  • 3
13 Comments
 
LVL 7

Expert Comment

by:Makr_Watson27
ID: 9908466
It maybe because you are not creating the session, try the following:

      strBody = ""
      strBody = strBody & "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"
      strBody = strBody & "<html><head><title>Subject</title></head><body><table>"
      strBody = strBody & "<tr><td> Sending E-mail !!!</td></tr>"
      strBody = strBody & "</table></body></html>"

      Dim objSession, objNewMail
      Set objSession = CreateObject ("CDONTS.Session")
      objSession.LogonSMTP "Sender", "Sender@myserver.com"

      Set objNewMail = CreateObject("CDONTS.NewMail")
      objNewMail.BodyFormat = 0
      objNewMail.MailFormat = 0

      objNewMail.Send "Sender@myserver.com", "Receiver@myserver.com", "Subject", strBody
      Set objNewMail = Nothing

      Set objSession = Nothing
0
 
LVL 3

Expert Comment

by:rhoggren
ID: 9908995
He shouldn't need to create a session though. He should be able to setup a cdonts.NewMail and just send it.

Author: When you say you get an HTTP500 error, do you have the IISHELP virtual directory set up in your IIS instance of your site to see the real error message?

If you do not and have the access to set this up, do that. You'll get a much better idea of what the real error message is.

I have an inkling feeling that it might be a "Permission Denied" message hiding behind that HTTP500 error

R-
0
 
LVL 7

Expert Comment

by:Makr_Watson27
ID: 9910500
Whoopes my mistake
Permissions idea may also apply to the drop directories etc, but normally you get a specific error but you could try article http://support.microsoft.com/?kbid=260985
0
 

Author Comment

by:shocking_ASP
ID: 9913429
Guys as rhoggren said I have  Permission Error ...
I don't know what shoud I do with it....please Help me...
and MAKR_WATSON27 the link didn't help me at all.thanks for your attention!
I'll be waiting for your answers.
regards,
Sam
0
 

Author Comment

by:shocking_ASP
ID: 9913432
Guys as rhoggren said I have  Permission Error ...
I don't know what shoud I do with it....please Help me...
and MAKR_WATSON27 the link didn't help me at all.thanks for your attention!
I'll be waiting for your answers.
regards,
Sam
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:Makr_Watson27
ID: 9913625
Did you follow rhoggren comment and install the IIS Help files, if so did you get a clearer error message and if so can you post it up.

If its error 8002801d then check
http://support.microsoft.com/default.aspx?scid=kb;en-us;259176

If its error 80090020 then check
http://support.microsoft.com/default.aspx?scid=kb;en-us;318478

If its error 800a0046 then check
http://support.microsoft.com/default.aspx?scid=kb;en-us;286301
0
 
LVL 3

Expert Comment

by:rhoggren
ID: 9913631
Ok cool, at least we know it's a permissions issue.

Here is what you will need to do:

Find where your IIS is installed (Default I believe is C:\INETPUB\

Look in that folder for "MAILROOT"

Look in Mailroot for two directories:

Drop
Pickup

You will have to make sure that your IUSR_MACHINENAME account has (I think) modify access to those two directories. If you aren't overly concerned with security and have time to play around, set the IUSR_MACHINENAME account to have modify permissions on all the directories under MailRoot and then remove them one by one.

I don't have access to a system to look at right this moment so I can't say for sure which directories absolutely need that set of permissions, but Im sure of Drop and Pickup needing them.

Hope this helps!!!

R-
0
 

Author Comment

by:shocking_ASP
ID: 9913961
Dear rhoggren,
You know I've got this Problem when I try it Onlineon my own website.
I thought It can't be because of the account or something like that...
and I don't think it can be because of my IIS !
Please Help me in this Case.
thanks....
regards,
Sam
0
 
LVL 3

Accepted Solution

by:
rhoggren earned 50 total points
ID: 9914758
Sam,

Are you saying that you do not have access to the server in a way that would allow you to change permissions?

I would think it would be "standard" for the ISP to set up those permissions for you in that case.. have you tried calling them and telling them about your permission denied error?

Are you getting a more detailed error message now? Can you copy/paste that here?
0
 
LVL 3

Expert Comment

by:rhoggren
ID: 13153513
Well, the error message received in this problem is definitely a permissions issue. The solution I provided would solve the issue if the person had access to the IIS console.

I don't mind what happens with the question, whatever you guys decide is cool with me :)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now