Solved

IIS 5.0 and ASP 3.0 (objMail)

Posted on 2001-06-17
27
407 Views
Last Modified: 2012-06-21
Hi,

I an using IIS 5.0 and ASP 3.0, i have installed the Microsoft Interdev 6.0 in my win2000.

May I know did the IIS 5.0 recognize the
Set objMail = CreateObject("CDONTS.NewMail")or not ?

because i try in Personal Web Server, i get the error ActiveX component error when i try to run the program with send mail coding.

May I know did IIS 5.0 recognize the
Set objMail = CreateObject("CDONTS.NewMail")be default ?

is it i have to install anything in order to make it recognize so that the send email can work.

actually i have write some coding regarding to send email but it doesn't work.

here is my coding:

EmailText = Request.Form("EmpName") & ", " & Request.Form("EmpEmail") _
          & " is requesting time off of work from " & Request.Form("FromDate") _
          & " to " & Request.Form("ToDate") & " for the following purpose:" _
          & chr(13) & chr(13) & Request.Form("Purpose") & "." & chr(13) & chr(13)
     
     EmailText = EmailText & "Use this link to Accept Request:" & chr(13) _
          & "http://dur-03-it/LeaveApplication/index.asp?Action=Yes&" _
          & "RequestID=" & RSRequestID("RequestID") & chr(13) _
          & "Use this link to Reject Request:" & chr(13) _    
          & "http://dur-03-it/LeaveApplication/index.asp?Action=No&" _
          & "RequestID=" & RSRequestID("RequestID") & chr(13)
         
     set RSSendTo = conn.Execute("select DepartmentContact from HRVacatRequestDepartments " _
          & "where DepartmentID = " & "'" & Request.Form("DepartmentID") & "'")

Set objMail = CreateObject("CDONTS.NewMail")
     objMail.Send Request.Form("EmpEmail") , RSSendTo("DepartmentContact"), _
     "Annual Leave Request", cstr(EmailText)
     Set objMail = Nothing
     TheMessage = "Request Submitted."

pls let me know did i have anything in my coding ?

please assists.

hoay fern
0
Comment
Question by:hoayfern
  • 15
  • 4
  • 4
  • +2
27 Comments
 
LVL 2

Expert Comment

by:DirkVe
Comment Utility
The problem is that you didn't install the CDO on your server (which is the machine you are working on).

I don't exactly on which MS cd you can find it in order to install it. For WIN NT it was in the option pack, but for WIN 2000 it's probably one of the cd's from WIN 2000 itself. When you installed WIN 2000 you had to select this (just like you had to do for IIS5). So insert you cd and install the right 'component' (SMTP and CDO).

You can also use another component (there are difefent free components on the internet). Most of them use just the same syntax. You can find one over here:
http://www.aspemail.com/

0
 

Expert Comment

by:taheri
Comment Utility
try this.....

Set objMail = Server.CreateObject("CDONTS.NewMail")

check for the cdonts.dll in the 'inetsrv' folder in the System32 folder.It is automatically installed when u install IIS 5.0

0
 
LVL 20

Accepted Solution

by:
Silvers5 earned 25 total points
Comment Utility
you'll need to install SMTP server or exchange for the cdo to run, on PWS it won't run since SMTP is not installed..try another component:

How do I send e-mail from ASP?

There are several components that enable you to do this. dy have one, There are also several other components available
 
    Genusa's AspMail
    http://www.serverobjects.com/products.htm#Aspmail
 
    ASPEmail
    http://www.aspemail.com/   <--free
 
    Dundas Mailer
    http://www.dundas.com/index.asp?/products/mailer
 
    MailListBot
    http://www.MailListBot.com/
 
    EasyMail
    http://www.easymailobjects.com/emobjects/smtp.asp
 
    w3 Jmail
    http://www.dimac.net/
 
    HTMLMailer / HTMLMailerPlus
    http://www.oopadelic.com/htmlmailer/
    http://www.oopadelic.com/htmlmailerplus/
 
    DevMailer
    http://www.geocel.com/devmailer/
 
    VSEmail
    http://www.vsoft-tech.com.au/vsemail/readme.html
 
    Mabry Mail
    http://www.mabry.com/mail/index.htm
 
    NNTPClient+SMTPClient
    http://www.liquidcool.com/asp
 
    SimpleMail
    http://www.adiscon.com/SimpleMail
 
    AB Active X Mailer
    http://www.geocities.com/ResearchTriangle/2656/abmailer.html
 
    OCXMail
    http://www.flicks.com/aspmail/
 
    WindMail
    http://www.geocel.com/windmail/
 
    Zaks.POP3
    http://www.zaks.demon.co.uk/code/cpts/pop/index.html


or you can stick to CDONTs but debug your cdonts application on the server
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
PWS will not recognise CDONTS.Newmail. Only IIS will recognise it. By default if IIS is installed, it will recognise this CDONTS object. Try to see if cdonts.dll is present in your system32 directory. To make sure that it is registered, you can do the following.

Click on Start->Run then type the below:
regsvr32 c:\winnt\system32\cdonts.dll

I am assuming you install IIS in C:\. Change the drive letter if your installation is in other drive.

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
In your coding, I suggest you use the below standard to make it more readable.
objMail.To = "receipent@domain.com"
objMail.Body = "Your_body_here"
objMail.Subject = "your_subject_here"
objMail.Send

hongjun
0
 
LVL 2

Expert Comment

by:DirkVe
Comment Utility
To use CDONTS you must have SMTP installed also when installing IIS. It's not by default.

Using another component like the one I mentioned before (http://www.aspemail.com/) will make it work also and easy. This components is also completely free and works even on workstations. I just it a lot of times, becasue the instalation is very simple:
-Copy the dll to the server (or wherever your web-application is)
-register it with regsvr32 aspemail.dll

Why do you use PWS when IIS is installed also? IIS is much better, and you don't have to change any options (default options will do). You are also using Interdev, and this will configure IIS for you when you create a new project.
0
 

Author Comment

by:hoayfern
Comment Utility
hi,

i found all my email under C:\Inetpub\mailroot\Queue.

May i know how can I configure my IIS 5.0 the Default SMTP Virtual Server.

i try to configure by add a new domain:

the first step: it ask me to spcify domain :
remote or alias

i choose alias.

then the second step it ask what is the address space of mail that is to be received by this domain:
i put duraco.com.sg

then i try my program again, it still doesn't send out any mails n the mails still in C:\Inetpub\mailroot\Queue.


i am using IIS 5.0, not PWS

pls assist

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi,
May I know what is the CDO stand for ?

and where can I get it, is it i have to install from somewhere even i am using IIS 5.0 ?

please assists

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi hongjun,

i have follow your instructions and register the CDONTS object and it is registered now

i try to run my program but still no emails sent to my email account

please assists

hoay fern
0
 
LVL 20

Expert Comment

by:Silvers5
Comment Utility
use any of the component I provided..
0
 

Author Comment

by:hoayfern
Comment Utility
hi Dirkve,

i have installed the Microsoft interDev 6.0  and i think i have installed the CDONTS as well

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi silver5,

if i wish to use the CDONTS ?

may i know is it i have to set the IIS properties : Default SMTP Virtual Server ??

setup a new domain because currently my domain is called dur-03-it.

please assists

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi Dirkve,

i am using IIS, not PWS

hoay fern
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:hoayfern
Comment Utility
hi DirkVe,

u mean To use CDONTS you must have SMTP installed also when installing IIS. It's not by default.


how can i install the SMTP ?

if i use the aspemail,is it i have to change my coding ? how can i change it ?

pls assist
0
 
LVL 20

Expert Comment

by:Silvers5
Comment Utility
the domain should be the email domain
0
 

Author Comment

by:hoayfern
Comment Utility
hi DirkVe,

i go to www.aspemail.com, it is free for 30 days only.

Download your free copy of AspEmail 4.5 (the premium features will be functional for 30 days after installation and will require a registration key afterwards.)

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi silver5,

u mean my email address is hoayfern.lee2duraco.com.sg, then my domain should be duraco.com.sg, right ?

but which one should i choose, the remote or alias ?

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi silver5,

u mean my email address is hoayfern.lee2duraco.com.sg, then my domain should be duraco.com.sg, right ?

but which one should i choose, the remote or alias ?

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi silver5,

i have setup a new domain in IIS, domain name :duraco.com.sg

then i try my program again, still no mails sent to my email account.

the mails store in C:\Inetpub\mailroot\Queue.
and it doesn't sent out .

below is the content of my mails:

From:jenny.lee@duraco.com.sg <jenny.lee@duraco.com.sg>
date:Monday, June 18, 2001 5:43 PM
To:hoayfern.lee@duraco.com.sg <hoayfern.lee@duraco.com.sg>
Subject: Annual Leave Application

Jenny Lee, jenny.lee@duraco.com.sg is requesting time off of work from
7/19/01 to 7/20/01 for the following purpose:

vacation.

Use this link to Accept Request:
http://dur-03-it/LeaveApplication/index.asp?Action=Yes&RequestID=22
Use this link to Reject Request:
http://dur-03-it/LeaveApplication/index.asp?Action=No&RequestID=22

0
 

Author Comment

by:hoayfern
Comment Utility
hi silver5,

i have setup a new domain in IIS, domain name :duraco.com.sg

then i try my program again, still no mails sent to my email account.

the mails store in C:\Inetpub\mailroot\Queue.
and it doesn't sent out .

below is the content of my mails:

From:jenny.lee@duraco.com.sg <jenny.lee@duraco.com.sg>
date:Monday, June 18, 2001 5:43 PM
To:hoayfern.lee@duraco.com.sg <hoayfern.lee@duraco.com.sg>
Subject: Annual Leave Application

Jenny Lee, jenny.lee@duraco.com.sg is requesting time off of work from
7/19/01 to 7/20/01 for the following purpose:

vacation.

Use this link to Accept Request:
http://dur-03-it/LeaveApplication/index.asp?Action=Yes&RequestID=22
Use this link to Reject Request:
http://dur-03-it/LeaveApplication/index.asp?Action=No&RequestID=22

0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Is your SMTP running? I ask this question since emails are in queues.

hongjun
0
 
LVL 20

Expert Comment

by:Silvers5
Comment Utility
in the delivery tab, advanced button.. you should add a fully qualified domain like:
smtpservername.duraco.com.sg  and check the dns to see if it's resolving ok

0
 
LVL 2

Expert Comment

by:DirkVe
Comment Utility
Do you have a mail-server that you want to use or not?
0
 
LVL 2

Expert Comment

by:DirkVe
Comment Utility
Do you have a mail-server that you want to use or not?
0
 

Author Comment

by:hoayfern
Comment Utility
hi everyone,

may i know how can I update the same data to 2 tables ?

example: after employee fill in the leave form, currently my program said that it will update the data in table called: HRVacatRequests , after that the employee clcik on submit button and the system will send email to HR officer and HR officer have 2 choice to accept their leave or reject their leave.

this is my current system working:

now i wish to add 1 features:
after HR Officer click on the Accept link like :

Use this link to Accept Request:
http://dur-03-it/AL/index.asp?Action=Yes&RequestID=4

then the data key in by employee such as employee ID, from date, todate also will be updated to table called:HRVacationTimeTaken

below is my coding:

if Request("Action")="" or Request("RequestID")="" then
     Response.Redirect "./html/vacation_request.asp"
else
set conn=server.CreateObject ("ADODB.connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Inetpub\wwwroot\HR\HRVacationTimeEmps.mdb;" & _
"Persist Security Info=False"
     
if Request.QueryString ("Action") = "Yes" then
Decision = "Approved"
     
conn.Execute "insert into HRVacationTimeTaken (EmpID, "_
&"FromDate, ToDate, DaysTaken) values (" _
& "'" & Request.Form ("EmpID") & "'" _
& "#" & Request.Form("FromDate") & "#, " _
& "#" & Request.Form("ToDate") & "#, " _
& Request.Form ("DaysTaken") & ")"
else
Decision = "Denied"
end if

the HR officer get email with 2 option:
Lee Hoay Fern, hoayfern.lee@duraco.com.sg is requesting time off of work from 7/21/01 to 7/22/01 for the following purpose:holiday.

Use this link to Accept Request:
http://dur-03-it/AL/index.asp?Action=Yes&RequestID=4
Use this link to Reject Request:
http://dur-03-it/AL/index.asp?Action=No&RequestID=4

after she click on the http://dur-03-it/AL/index.asp?Action=Yes&RequestID=4

it should update the data key in by employee into table called HRVacationTimeTaken but i get the below error:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '''##'.
/AL/index.asp, line 16

the line 16 is :

conn.Execute "insert into HRVacationTimeTaken (EmpID, "_
&"FromDate, ToDate, DaysTaken) values (" _
& "'" & Request.Form ("EmpID") & "'" _
& "#" & Request.Form("FromDate") & "#, " _
& "#" & Request.Form("ToDate") & "#, " _
& Request.Form ("DaysTaken") & ")"

please check for me if i have any syntax error

pls assist

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi,

how can i add the another send email to another user which is Bcc to ?

Set JMail = Server.CreateObject("JMail.SMTPMail")
     JMail.ServerAddress = "192.168.168.170"
     JMail.Sender = Request.Form("EmpEmail")
     JMail.Subject = "Annual Leave Application"
     JMail.AddRecipient RSSendTo("DepartmentContact")
     JMail.Body = EmailText
     TheMessage = "Request Submitted."
     JMail.Priority = 3
     JMail.Execute
     set JMail=nothing

please assist

hoay fern
0
 

Author Comment

by:hoayfern
Comment Utility
hi,

how can i add the another send email to another user which is Bcc to ?

Set JMail = Server.CreateObject("JMail.SMTPMail")
     JMail.ServerAddress = "192.168.168.170"
     JMail.Sender = Request.Form("EmpEmail")
     JMail.Subject = "Annual Leave Application"
     JMail.AddRecipient RSSendTo("DepartmentContact")
     JMail.Body = EmailText
     TheMessage = "Request Submitted."
     JMail.Priority = 3
     JMail.Execute
     set JMail=nothing

please assist

hoay fern
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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/…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

17 Experts available now in Live!

Get 1:1 Help Now