|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Cdonts
I'm having problems with CDONTS. I want people to enter my site, send me an e-mail and I want them to recieve an autoresponse (in their mailbox). Something like "We will contact you as soon as possible... etc...", with some news or latest promotions, etc. I use Flash with ASP. I am not a programmer, but a web designer, so I don't know a lot about programming or ASP.
The mail form and one part of the code is inside Flash, and it is my ASP above. So far users can get my page and send me a mail. And I recieve it. The problem is I can't figure out what should I do so they can receive an autoresponse, some .txt or .html file. Thank you very much. <%@Language=VBScript%> <%Option Explicit%> <%Response.Buffer = True%> <% Dim Mailer Dim msgTxt msgTxt = Request("name") & vbCrLf msgTxt = msgTxt & "le ha enviado el siguiente mensaje:" & vbCrLf & vbCrLf msgTxt = msgTxt & Request("message") 'CDONTS Mail setup Set Mailer = Server.CreateObject("CDONTS.Newmail") Mailer.Send Request("email"), Request("recipient"), Request("subject"), msgTxt Set Mailer = nothing Response.Write "mailSent=true" %> |
|
#2
|
|||
|
|||
|
I don't fully understand what you are trying to achieve. If you want to send an email to yourself with a message the user typed and you want to give a message back at the press of a button. Then you should try this.
Code:
' Send the response mail
Dim mailer AS Object
Dim HTML AS String
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=Content-Type"
HTML = HTML & "content=text/html; charset=iso-8859-1>"
HTML = HTML & "<title></title>"
HTML = HTML & "</head>"
HTML = HTML & "<body>"
' message is the name of the inputarea.
HTML = HTML & Request.Form("message")
HTML = HTML & "</body>"
HTML = HTML & "</html>"
' Send the email to yourself
Set mailer = Server.CreateObject("CDONTS.NewMail")
mailer.From = "youremail@test.com"
mailer.To = "youremail@test.com"
mailer.Importance = 2
mailer.BodyFormat = 0
mailer.Mailformat = CdoMailFormatMime
mailer.Subject = "Response via the Website"
mailer.Body = HTML
mailer.Send
Set mailer = Nothing
mailResults = result
' Send the response mail
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=Content-Type"
HTML = HTML & " content=text/html; charset=iso-8859-1>"
HTML = HTML & "<title></title>"
HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "We'll contact you a.s.a.p."
HTML = HTML & "</body>"
HTML = HTML & "</html>"
Set mailer = Server.CreateObject("CDONTS.NewMail")
mailer.From = "youremail@test.com"
' UserEmail being the field where the user fills out his or
' her email address
mailer.To = Request.Form("UserEmail")
mailer.Importance = 2
mailer.BodyFormat = 0
mailer.Mailformat = CdoMailFormatMime
mailer.Subject = "Subject"
mailer.Body = HTML
mailer.Send
Set mailer = Nothing
mailResults = result
I hope this is of some use. Let me know if it works out for you. Last edited by Tim_Lensen : August 14th, 2003 at 02:41 PM. |
|
#3
|
|||
|
|||
|
Thank you very very much!!!!! I'll try it. I'm sorry, I guess I didn't attach my code. And here it is.
<%@Language=VBScript%> <%Option Explicit%> <%Response.Buffer = True%> <% Dim Mailer Dim msgTxt msgTxt = Request("name") & vbCrLf msgTxt = msgTxt & "le ha enviado el siguiente mensaje:" & vbCrLf & vbCrLf msgTxt = msgTxt & Request("message") 'CDONTS Mail setup Set Mailer = Server.CreateObject("CDONTS.Newmail") Mailer.Send Request("email"), Request("recipient"), Request("subject"), msgTxt Set Mailer = nothing Response.Write "mailSent=true" %> |
|
#4
|
|||
|
|||
|
It doesn't appear... Well, let's try again... Do you have mail?
'<%@Language=VBScript%> '<%Option Explicit%> '<%Response.Buffer = True%> ' '<% 'Dim Mailer 'Dim msgTxt ' 'msgTxt = Request("name") & vbCrLf 'msgTxt = msgTxt & "le ha enviado el siguiente mensaje:" & vbCrLf & vbCrLf 'msgTxt = msgTxt & Request("message") ' 'CDONTS Mail setup 'Set Mailer = Server.CreateObject("CDONTS.Newmail") 'Mailer.Send Request("email"), Request("recipient"), Request("subject"), msgTxt 'Set Mailer = nothing ' ' 'Response.Write "mailSent=true" '%> |
|
#5
|
|||
|
|||
|
Are you sure you put the code between
PHP Code:
Last edited by Tim_Lensen : August 16th, 2003 at 02:08 PM. |
|
#6
|
|||
|
|||
|
Yes, I do put <%%>, but the code doesn't appear...
<% Dim Mailer Dim msgTxt msgTxt = Request("name") & vbCrLf msgTxt = msgTxt & "le ha enviado el siguiente mensaje:" & vbCrLf & vbCrLf msgTxt = msgTxt & Request("message") Set Mailer = Server.CreateObject("CDONTS.Newmail") Mailer.Send Request("email"), Request("recipient"), Request("subject"), msgTxt Set Mailer = nothing Response.Write "mailSent=true" %> |
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Cdonts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|