Forums
This topic is locked
ASP and Mail??
Posted 09 Jun 2002 21:24:16
1
has voted
09 Jun 2002 21:24:16 aegis kleais posted:
What's the easiest way/system to use if I want automated email messages to be made (ie, I setup the format of the letter and then on an even have the email send (not through the clients email, but from internally) I'm looking for FREE solutions btw... Replies
Replied 09 Jun 2002 23:00:01
09 Jun 2002 23:00:01 Jeremy Conn replied:
*NOTE: A good idea to get answers to your questions is to put down all your information (like below my signature) because most answers will be affected by the technology you are using.
ANSWER: If you are using IIS on a Windows server, than <b>CDONTS</b> should be installed by default, and is one of the easiest ways to send email. There are dozens of extensions on <b>MM Extensions</b> site, or there are various tutorials on how to construct CDONTS emails yourself.
<b>MM Extensions</b>
dynamic.macromedia.com/bin/MM/exchange/main.jsp?product=ultradev
<b>CDONTS Tutorial</b>
www.troutflap.clara.net/Attack/Monkeypages/CDO.htm
(UD4|IIS5|WXP|ASP)
*Connman21*
www.conncreativemedia.com
ANSWER: If you are using IIS on a Windows server, than <b>CDONTS</b> should be installed by default, and is one of the easiest ways to send email. There are dozens of extensions on <b>MM Extensions</b> site, or there are various tutorials on how to construct CDONTS emails yourself.
<b>MM Extensions</b>
dynamic.macromedia.com/bin/MM/exchange/main.jsp?product=ultradev
<b>CDONTS Tutorial</b>
www.troutflap.clara.net/Attack/Monkeypages/CDO.htm
(UD4|IIS5|WXP|ASP)
*Connman21*
www.conncreativemedia.com
Replied 09 Jun 2002 23:49:13
09 Jun 2002 23:49:13 aegis kleais replied:
Everything you assumed is dead on. And by reading up on this CDONTS I find that you need to alter settings on IIS. This is fine and all when I alter them and test them locally, but when I upload my page, I don't have access to my host's server IIS settings, so I can't make the changes necessary there....
I'll look into MM_Exchange for ASP Mail proggies. I did a plugin once before and it ruined Dreamweaver. So I'm a lil iffy on it.....but I'll try again
I'll look into MM_Exchange for ASP Mail proggies. I did a plugin once before and it ruined Dreamweaver. So I'm a lil iffy on it.....but I'll try again
Replied 10 Jun 2002 06:42:47
10 Jun 2002 06:42:47 Jeremy Conn replied:
Not sure what exactly led you to believe that changes were required on the server, but using CDONTS should only require it being installed.
All CDONTS is used for is as a carrier/device to send the email, as all the settings are donw in your code. (See example)
<b>EXAMPLE: This is an example CDONTS Email code snippet.</b>
<font color=red><%
<font color=green>' Check that the form has been submitted, and if it has, sort out and send the email. To do this we check the count for the submit button. If the button has been pressed, its count will be greater than 0</font id=green>
If Request.Form("btnSubmit".Count > 0 Then
<font color=green>' Create the message for the email</font id=green>
strMessage = "Here is a questinnaire from your website" & VbCrlf & VbCrlf
strMessage = strMessage & "Name: " & Request.Form("yourname" & VbCrlf
strMessage = strMessage & "Email: " & Request.Form("email" & VbCrlf
strMessage = strMessage & "Number of Cats Owned: " & Request.Form("numberofcats" & VbCrlf
strMessage = strMessage & "Favourite brand of catfood: " & Request.Form("catfood" & VbCrlf
strMessage = strMessage & "Where they buy their catfood: " & Request.Form("wherebought" & VbCrlf
<font color=green>' Create email object and set all the values, setting the from address to be the person who filled in the form</font id=green>
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.To = " "
objMail.cc = " "
objMail.From = Request.Form("email"
objMail.Subject = "Web Site Questionnaire submission"
objMail.Body = strMessage
<font color=green>' Send the mail and tidy up</font id=green>
objMail.Send
Set objMail = Nothing
<font color=green>' Redirect to thankyou page</font id=green>
Response.Redirect "thanyou.htm"
End If
%></font id=red>
(UD4|IIS5|WXP|ASP)
*Connman21*
www.conncreativemedia.com
All CDONTS is used for is as a carrier/device to send the email, as all the settings are donw in your code. (See example)
<b>EXAMPLE: This is an example CDONTS Email code snippet.</b>
<font color=red><%
<font color=green>' Check that the form has been submitted, and if it has, sort out and send the email. To do this we check the count for the submit button. If the button has been pressed, its count will be greater than 0</font id=green>
If Request.Form("btnSubmit".Count > 0 Then
<font color=green>' Create the message for the email</font id=green>
strMessage = "Here is a questinnaire from your website" & VbCrlf & VbCrlf
strMessage = strMessage & "Name: " & Request.Form("yourname" & VbCrlf
strMessage = strMessage & "Email: " & Request.Form("email" & VbCrlf
strMessage = strMessage & "Number of Cats Owned: " & Request.Form("numberofcats" & VbCrlf
strMessage = strMessage & "Favourite brand of catfood: " & Request.Form("catfood" & VbCrlf
strMessage = strMessage & "Where they buy their catfood: " & Request.Form("wherebought" & VbCrlf
<font color=green>' Create email object and set all the values, setting the from address to be the person who filled in the form</font id=green>
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.To = " "
objMail.cc = " "
objMail.From = Request.Form("email"
objMail.Subject = "Web Site Questionnaire submission"
objMail.Body = strMessage
<font color=green>' Send the mail and tidy up</font id=green>
objMail.Send
Set objMail = Nothing
<font color=green>' Redirect to thankyou page</font id=green>
Response.Redirect "thanyou.htm"
End If
%></font id=red>
(UD4|IIS5|WXP|ASP)
*Connman21*
www.conncreativemedia.com
Replied 10 Jun 2002 17:52:48
10 Jun 2002 17:52:48 aegis kleais replied:
I coulda swore that I read a document that said "Make sure CDONTS is enabled on IIS" Oh well, I installed a CDONTS plugin for UltraDEV 4 and it installed the exact same code that you listed. However, it doesn't tell me how I trigger this?
By what I know in ASP, does it try to send the email when a certain form is submitted? I assume that I can place dynamic info into the body of the email by altering the body construct code with ASP variables and other strings. Thanks for your help. Getting an ability to send email (not reliant on the visitor's client and such) would be a great addition.
By what I know in ASP, does it try to send the email when a certain form is submitted? I assume that I can place dynamic info into the body of the email by altering the body construct code with ASP variables and other strings. Thanks for your help. Getting an ability to send email (not reliant on the visitor's client and such) would be a great addition.
Replied 10 Jun 2002 22:23:09
10 Jun 2002 22:23:09 David Behan replied:
Hi aegiskleais,
I have answered a bunch of questions on CDONTS, Newsletters, etc. If you search for cdonts, or my name you should find most of the answers you are looking for.
In short you build a form with whatever details you want - name, email, subject, importance, message for example and a hidden field called "sendoutmail" and the value as "Y". Then point the form to post to sendmail.asp. On the sendmail.asp use the script connman showed you. E.g.
IF Request.Form("sendoutmail" = "Y" THEN
' Create the message for the email
strMessage = "Here is a questinnaire from your website" & VbCrlf & VbCrlf
strMessage = strMessage & "Name: " & Request.Form("yourname" & VbCrlf
strMessage = strMessage & "Email: " & Request.Form("email" & VbCrlf
strMessage = strMessage & "Number of Cats Owned: " & Request.Form("numberofcats" & VbCrlf
strMessage = strMessage & "Favourite brand of catfood: " & Request.Form("catfood" & VbCrlf
strMessage = strMessage & "Where they buy their catfood: " & Request.Form("wherebought" & VbCrlf
' Create email object and set all the values, setting the from address to be the person who filled in the form
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.To = " "
objMail.cc = " "
objMail.From = Request.Form("email"
objMail.Subject = "Web Site Questionnaire submission"
objMail.Body = strMessage
' Send the mail and tidy up
objMail.Send
Set objMail = Nothing
' Redirect to thankyou page
Response.Redirect "thanyou.htm"
End If
=========================
END CODE
Once you submit to this page from the form page, cdonts should send the mail or give you an error. So have a look at the previous posts and try it out. If it works great... if it doesn't - even better. Cause if you make a mistake you will learn from it. If you can't find the answer from previous posts then just shout.
Regards,
Dave...
p.s. Connman... I just used your code there... hope you don't mind? Didn't want to type out my own or go look for some already done. Cheeurs.
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
I have answered a bunch of questions on CDONTS, Newsletters, etc. If you search for cdonts, or my name you should find most of the answers you are looking for.
In short you build a form with whatever details you want - name, email, subject, importance, message for example and a hidden field called "sendoutmail" and the value as "Y". Then point the form to post to sendmail.asp. On the sendmail.asp use the script connman showed you. E.g.
IF Request.Form("sendoutmail" = "Y" THEN
' Create the message for the email
strMessage = "Here is a questinnaire from your website" & VbCrlf & VbCrlf
strMessage = strMessage & "Name: " & Request.Form("yourname" & VbCrlf
strMessage = strMessage & "Email: " & Request.Form("email" & VbCrlf
strMessage = strMessage & "Number of Cats Owned: " & Request.Form("numberofcats" & VbCrlf
strMessage = strMessage & "Favourite brand of catfood: " & Request.Form("catfood" & VbCrlf
strMessage = strMessage & "Where they buy their catfood: " & Request.Form("wherebought" & VbCrlf
' Create email object and set all the values, setting the from address to be the person who filled in the form
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.To = " "
objMail.cc = " "
objMail.From = Request.Form("email"
objMail.Subject = "Web Site Questionnaire submission"
objMail.Body = strMessage
' Send the mail and tidy up
objMail.Send
Set objMail = Nothing
' Redirect to thankyou page
Response.Redirect "thanyou.htm"
End If
=========================
END CODE
Once you submit to this page from the form page, cdonts should send the mail or give you an error. So have a look at the previous posts and try it out. If it works great... if it doesn't - even better. Cause if you make a mistake you will learn from it. If you can't find the answer from previous posts then just shout.
Regards,
Dave...
p.s. Connman... I just used your code there... hope you don't mind? Didn't want to type out my own or go look for some already done. Cheeurs.
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replied 10 Jun 2002 23:33:48
10 Jun 2002 23:33:48 aegis kleais replied:
I found the document where they make sure you have IIS (MMC) setup properly. Right now I've cut and pasted the code they shown but I'm still getting errors "ActiveX cannot create CDONTS.NewMail"
I followed steps til where it asks to give your SMTP server a name in the SMART HOST section. Right now the IIS says it's Default SMTP so I just gave it the name of the server.
I followed steps til where it asks to give your SMTP server a name in the SMART HOST section. Right now the IIS says it's Default SMTP so I just gave it the name of the server.
Replied 11 Jun 2002 10:59:20
11 Jun 2002 10:59:20 David Behan replied:
Can you check whether you have CDONTS or CDO 2000 installed as there are a few differences in the commands.
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2