Solved

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

Posted on 2003-12-09
13
334 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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