Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IIS 5.0 and ASP 3.0 (objMail)

Posted on 2001-06-17
27
Medium Priority
?
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 4
  • 4
  • +2
27 Comments
 
LVL 2

Expert Comment

by:DirkVe
ID: 6201101
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
ID: 6201124
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:
Michel Sakr earned 100 total points
ID: 6201273
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 33

Expert Comment

by:hongjun
ID: 6201276
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
ID: 6201284
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
ID: 6201454
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
ID: 6201487
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
ID: 6201495
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
ID: 6201522
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:Michel Sakr
ID: 6201539
use any of the component I provided..
0
 

Author Comment

by:hoayfern
ID: 6201551
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
ID: 6201556
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
ID: 6201558
hi Dirkve,

i am using IIS, not PWS

hoay fern
0
 

Author Comment

by:hoayfern
ID: 6201568
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:Michel Sakr
ID: 6201571
the domain should be the email domain
0
 

Author Comment

by:hoayfern
ID: 6201579
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
ID: 6201592
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
ID: 6201603
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
ID: 6201621
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
ID: 6201627
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
ID: 6201636
Is your SMTP running? I ask this question since emails are in queues.

hongjun
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6201648
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
ID: 6201650
Do you have a mail-server that you want to use or not?
0
 
LVL 2

Expert Comment

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

Author Comment

by:hoayfern
ID: 6212673
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
ID: 6212718
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
ID: 6212798
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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 informatio…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

718 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