Solved

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

Posted on 2003-12-09
13
330 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

19 Experts available now in Live!

Get 1:1 Help Now