SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 10th, 2003, 11:48 AM
whyzz whyzz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Spartanburg, SC
Posts: 2 whyzz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question send confirmation email from ASP form

I have a Frontpage-ASP form that allows users to add their names to a database and indicate their interests for a newsletter that I do.

I want to send a confirmation email from my system account when they submit the form. I don't want to use their SMTP because I also want to see what bounces from the address submitted.

Frontpage does not allow sending to email and to a database at the same time.

Please point me in a direction to figure out what to do.


Reply With Quote
  #2  
Old July 10th, 2003, 08:13 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Blah

Call this function after a successfull insert into the DB. Fyi, i did something like this similar too, and what i did was if this is an account thing, have a field in DB called active, and when you send the email, auto gen a number, then put that in the db under active, and then email them the auto gen number, and have a link back to a page on your site to do a GET with the autogen number and their email addy, if they match, pop, change their active column in the db to their email name, and then in future calls to the db (when you're checking the users interests) check to make sure active and user id are the same. Not only did i want to give you this advice, but also, does anyone else have any problems with this code, as in, does this seem like a good/decent way of doing it?

Function EmailCdonts(byval strAuthorEmail,byval strRecipientEmail,ByVal strCC, byval strSubject,byval strBody,
ByVal intMailFormat,ByVal strAttachmentPath,ByVal intPriority)

Dim ObjMail


Set ObjMail = Server.CreateObject("CDONTS.NewMail")
' don't put set if you're using aspx

ObjMail.FROM = strAuthorEmail
ObjMail.TO = strRecipientEmail
ObjMail.Cc = strCC

ObjMail.Subject = strSubject

ObjMail.BodyFormat = intMailFormat
ObjMail.MailFormat = intMailFormat
ObjMail.Body = strBody

' CdoHigh = 2 - Highest priority (Urgent)
' CdoNormal = 1 - Normal
' CdoLow = 0 - Lowest
ObjMail.Importance = intPriority


If strAttachmentPath <> "" Then
ObjMail.AttachFile strAttachmentPath
End If

ObjMail.Send

Set ObjMail= Nothing

End Function

Reply With Quote
  #3  
Old July 22nd, 2003, 08:33 PM
whyzz whyzz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Spartanburg, SC
Posts: 2 whyzz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy thanks, but it CDONTS

Thanks for the effort and the info.

My server runs IIS6, so I have learned that I need CDOSYS, which works much the same as CDONTS--in fact, exactly the same on my application. It doesn't. I'm working with our network admin to get more details on Exchange and SMTP, which I hope is the answer.

As near as I can tell the code runs fine except that it does not get the recipient's email address when the form is processed to the database.

I guess I need to write the whole thing from scratch anyway.

Again, thanks for the effort.

Reply With Quote
  #4  
Old July 22nd, 2003, 08:51 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Quote:
My server runs IIS6, so I have learned that I need CDOSYS, which works much the same as CDONTS--in fact, exactly the same on my application. It doesn't. I'm working with our network admin to get more details on Exchange and SMTP, which I hope is the answer.


It doesn't matter what version of IIS you're running. This code is working fine under IIS6 for my company. I thought you said you didn't want smtp, but if you're doing it through exchange goodluck, ADVICE: the easiest way to do it is just have the author be an exchange account and any returned questions are returned to that account as well as any delivery failures. This isn't through exchange but it's still an exchange front.....

Quote:
As near as I can tell the code runs fine except that it does not get the recipient's email address when the form is processed to the database.


this is your part, you'll pass in the recipients email to the funtion, when you insert that variable representing the recipients email to the db, you'll pass that to the function, i had assumed you know how to grab the persons email youre sending it too...cause if you can't do that you're not going to get very far with sending that person an email.

SMTP
i assume you're running 2000 or higher since this code uses CDO.

<%
Const cdoSendUsingMethod = _
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = _
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = _
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = _
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = _
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = _
"http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = _
"http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields

' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp_server_name"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "username"
.Item(cdoSendPassword) = "password"

.Update
End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage
.To = "Display Name <email_address>"
.From = "Display Name <email_address>"
.Subject = "SMTP Relay Test"
.TextBody = "SMTP Relay Test Sent @ " & Now()
.Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>


If this doesn't help, go strait to microsoft

http://support.microsoft.com/defaul...b;en-us;Q286431

I hope this helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > send confirmation email from ASP form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway