Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-22-2007, 07:49 PM   #1 (permalink)
New Member
 
Join Date: Mar 2007
Posts: 5
Default email response help

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.
fasedor is offline   Reply With Quote
Old 04-22-2007, 10:06 PM   #2 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

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.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 04-23-2007, 03:11 PM   #3 (permalink)
New Member
 
Join Date: Mar 2007
Posts: 5
Default

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
fasedor is offline   Reply With Quote
Old 04-23-2007, 08:17 PM   #4 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

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")
now in below this bit of code you would put the code for the CDOSYS object as shown in the tutorial. this should look something like...

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
and finally to redirect the user to your thank you page, unless you want them to see a blank page that is

Code:
Response.Redirect("thank_you_page.htm")
%>
hope that works for ya... let me know if you have any questions.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 04-23-2007, 08:21 PM   #5 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

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.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 04-24-2007, 03:47 PM   #6 (permalink)
New Member
 
Join Date: Mar 2007
Posts: 5
Default

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.
fasedor is offline   Reply With Quote
Old 04-25-2007, 09:15 AM   #7 (permalink)
New Member
 
Join Date: Mar 2007
Posts: 5
Default

Solved
Thank you for your help again.
fasedor is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 03:49 AM.


Computer Forum - Internet Business - Webpage Design

 
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.