|
|
#1 (permalink) |
|
New Member
![]() Join Date: Mar 2007
Posts: 5
|
GREETINGS PEOPLE
I would like to use one asp script but i'm just not familiar with programing so any help would be nice. The scenario is next: When some visitor come to my form.html page he/she needs to submit his/her name and e-mail address and then click submit button to be redirected to say thankyou.html. Now i would like to email the user instantly when he/she submit the form ( he basically get automatic response ) with e-mail message like " Thank you for submiting those infos ". I just don't know the code for that and please provide me with some examples. After all i would like to check that script in iis 5.1 with SMTP server on win xp to be sure that everything work if it's possible. So THANK YOU guy's for all.
|
|
|
|
|
|
#2 (permalink) |
|
Super Noob
![]() |
what mail components does your host support? asp doesn't have a build in mail module. for this it uses components. most popular are persists aspmail and aspsmartmail from a company called aspsmart.
based on what components your host supports, you will need to write the code. it's very simple and i'd be happy to help once you know what component you have to go with. |
|
|
|
|
|
#3 (permalink) |
|
New Member
![]() Join Date: Mar 2007
Posts: 5
|
Thank's for reply
The component would be CDOSYS component. I hope i'm clear about what i wish to accomplish. Again when user submit his e-mail address in that field like: (john@xxxxxx.com) and click on submit button he get instant response to that submitted address (john@xxxxxx.com) with those " thank you " message. So please help if you or anybody can. Thank's again
|
|
|
|
|
|
#4 (permalink) |
|
Super Noob
![]() |
here is a decent tutorial explaining how to use the CDOSYS object.
http://hosting.fast-trak.net/tutoria...p_tutorial.htm to automatically insert the email address the user submitted you do something like this... 1. i am gonna assume the email address field in the html form is called "email_address" Code:
<%@ Language="VBSCRIPT" %>
<%
' declaring a variable
dim user_email_address
' setting the variable equal to the user submitted value
user_email_address = Request.Form("email_address")
Code:
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = "you@yourdomain.com"
MyMail.To = user_email_address
MyMail.Subject = "Thank you from YourDomain.com"
MyMail.TextBody = "Thank you for your participation... bla bla bla " &_
"bla bla bla"
MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpserver") = "your smtp server"
' if your smtp server requires authentication add the following three lines
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpauthenticate") = 1
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendusername") = "account name"
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendpassword") = "account password"
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpserverport") = 25
MyMail.Fields.Update()
MyMail.Send()
Set MyMail = Nothing
![]() Code:
Response.Redirect("thank_you_page.htm")
%>
|
|
|
|
|
|
#5 (permalink) |
|
Super Noob
![]() |
one thing i forgot to mention...
put the above mentioned code into a seperate file and i am just gonna assume you will call it "mail.asp". in your html form you will need to set this file as the action, so when the form is submitted, it calls the asp file before redirecting the user to the thank you page. |
|
|
|
|
|
#6 (permalink) |
|
New Member
![]() Join Date: Mar 2007
Posts: 5
|
Thank's for your effort to help
I tested the code with iis 5.1 and smtp virtual server to be sure that everything is working. The result: The code seems to be ok , but when i want to send the message with that smtp server the message stay in queue folder never leaving out . I'm not sure that the settings in that server are corect. What i did is: I was the anonymous user who submited email address on that html page with one correct one like ( blabla@blablabla.com - that is my valid address on remote isp on internet, and i'm not connected to internet through them while testing this stuff) At the end the thank you messagge as i said never leaved out the queue folder and never come to my blabla@blablabla.com address. So what the hell is the problem. I suppose the settings are not corect in smtp server, if you could please help me anyway i would be very grateful. Thank's again
Last edited by fasedor; 04-24-2007 at 03:50 PM. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|