|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. ![]() |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
Quote:
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:
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > send confirmation email from ASP form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|