Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 25th, 2004, 09:02 AM
Authorized User
 
Join Date: Jun 2004
Location: miami, fl, USA.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending e-mail to different mail box!


I would like to know if this can be achieved! On the form I a drop down menu that's called ("Escalation_type") the values are eta, hdtv, and supervisors. I have some ideas but I am not sure if it will work or not. If the use chooses an eta as a value I would like it to be sent a mailbox for exam: no@where.com. If they choose hdtv as value I would like it to be sent to a different mailbox. Can this be achieve by using the case statement or the if statement?

Thank you



  #2 (permalink)  
Old August 25th, 2004, 08:44 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,

  Yes, it is possible. But you have to have a condition to check the value selected. If so, you are not sure how many values may be there in the drop down box. If it is limited then OK.


set sndMail=server.createObject("CDONTS.NewMail")
If request("selEsc")="eta" then
  sndMail.To="no@where.com"
elseif request("selEsc")="hdtv" then
  sndMail.To="other@domain.com"
end if




  #3 (permalink)  
Old August 26th, 2004, 09:31 AM
Authorized User
 
Join Date: Jun 2004
Location: miami, fl, USA.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am getting the following error when an email is sent.

CDO.Message.1 error '8004020c'

At least one recipient is required, but none were found.

/forms/Confirmation.asp, line 88

Line 88 is objCdoSys.Send()


Dim objCdoSys, cdoConf, cdoFlds


If request.form("Escalation_Type")="Eta" then


objCdoSys.To = "no@where.com"

elseif request.form("Escalation_Type")="HDTV" then


objCdoSys.To = "no@where.com"


elseif request.form("Escalation_Type")="Supervisor" then

objCdoSys.To = "no@where.com"


end if


Set objCdoSys = Server.CreateObject("CDO.Message")
Set cdoConf = Server.CreateObject("CDO.Configuration")
set cdoFlds = cdoConf.Fields
With cdoFlds
.Item("http://schemas.microsoft.com/cdo/co...ation/sendusing") = 2 '1 is default and means server on local machine, 2 means remote server
.Item("http://schemas.microsoft.com/cdo/co...tion/smtpserver") ="my.domain.com" 'here is the remote server we want to send through
.Update
End With

Set objCdoSys.Configuration = cdoConf
objCdoSys.From ="no@where.com"
'objCdoSys.To = "no@where.com"

objCdoSys.Subject = "A form was just sent to you!"
objCdoSys.TextBody = "Please click here: no@where.com "
objCdoSys.Fields("urn:schemas:httpmail:importance" ).Value = 1
objCdoSys.Fields.Update()
objCdoSys.Send()

Set objCdoSys = Nothing


  #4 (permalink)  
Old August 26th, 2004, 08:16 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi,

  Response.write objCdoSys.To

and see whether any email ID is assigned or not.



  #5 (permalink)  
Old September 3rd, 2004, 05:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Calibus,

What is there on line number 88? Looks like TO is not specified at all, which means none of the Escalation_Type conditions were satisfied.

Check that out.

_________________________
- Vijay G
Strive for Perfection


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
sending mail hastikeyvan ASP.NET 2.0 Basics 0 June 10th, 2006 08:17 AM
sending mail anita VB How-To 3 September 30th, 2004 03:48 PM
sending an e-mail Calibus Classic ASP Databases 3 August 22nd, 2004 07:45 PM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.