Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-28-2013, 02:56 PM   PM User | #1
rshekhar21
New Coder

 
Join Date: Jan 2013
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
rshekhar21 is an unknown quantity at this point
auto response from my asp form mailer script

hi,
i am using a free asp script i got over the internet to run my contact us form from my website.
i am using a windows hosting and have configured my email account on google aps mail, and i am running fine with the script, i mean the script is working fine. actually i don't know anything about any script language. i only know html and css. however i know basic programming fundamentals.

the question is i need a little experiment in my .asp script so that i get more out of it. the first thing which i need is an auto response mail to the sender that to in a defined style. and the second thing which i need is, is it possible to get all the data in an exl file if or when required. i am just pasting here under my script so that you can check it and if anything can be done i will be highly grateful. it know it is not a big deal for any .asp programmer.

<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
' Freeware from Seiretto.com
' available at http://asp.thedemosite.co.uk
'
' DON'T forget to change the mail_to email address below!!!
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''
mail_to = "name@email.com" [ i have changed the email id ]

Dim error
error = 0
For Each f In Request.Form
If Request.Form(f) = "" Then
error = 1
End If
Next
If error=1 Then
response.redirect "error.html"
Else
Dim f, emsg, mail_to, r, o, c, other
fline = "_______________________________________________________________________"& vbNewLine
hline = vbNewLine & "_____________________________________"& vbNewLine
emsg = ""

For Each f In Request.Form
If mid(f,1,1)<>"S" = True Then 'do not save if input name starts with S
emsg = emsg & f & " = " & Trim(Request.Form(f)) & hline
End If
Next

Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = Request("Email")
objNewMail.Subject = "Message from contact page"
objNewMail.To = mail_to
objNewMail.Body = emsg & fline
objNewMail.Send
Set objNewMail = Nothing

response.redirect "../thankyou.html"
End if
%>


the mail which i receive using this script is totally un-styled, i mean it comes in no defined format, sometime subject comes first, sometime cell no. and sometime name. i need the mail in a styled manner as per the html form which i will paste under this.

<div id="c-form">
<form action="asp/contact.asp" method="post" onSubmit="MM_validateForm

('Name','','R','Email','','RisEmail','Cell','','R','Company','','R','subject','','R','Message','','R ');return document.MM_returnValue">
<fieldset>
<label for="Title">Title:</label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="Title" value="Mr." tabindex="0" checked style="margin-right: 5px;"/>
Mr.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="Title" value="Ms." tabindex="0" style="margin-right: 5px;"/>
Ms.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="Title" value="Mrs." tabindex="0" style="margin-right: 5px;"/>
Mrs. <br>
<br>
<label for="Name">Name:<span style="color:red;">*</span></label>
<br>
<input name="Name" type="text" required class="ip" id="Name" placeholder="Your Full Name" tabindex="2" maxlength="30"/>
<br>
<br>
<label for="Email">Email:<span style="color:red;">*</span></label>
<br>
<input name="Email" type="text" required class="ip" id="Email" placeholder="name@email.com" tabindex="3" maxlength="30"/>
<br>
<br>
<label for="Cell">Cell Phone:<span style="color:red;">*</span></label>
<br>
<input name="Cell" type="text" required class="ip" id="Cell" placeholder="Enter Phone number" tabindex="4" maxlength="12"/>
<br>
<br>
<label for="Company">Company/Organization:<span style="color:red;">*</span></label>
<input name="Company" type="text" required class="ip" id="Company" placeholder="Enter Company Name" tabindex="5"maxlength="30"/>
<br>
<br>
<label for="subject">Subject:<span style="color:red;">*</span></label>
<br>
<input name="subject" type="text" required class="ip" id="subject" placeholder="Eg. Enquiry; Order; Complain; etc..." tabindex="6" maxlength="30"/>
<br>
<br>
<label for="Message">Message:<span style="color:red;">*</span></label>
<textarea name="Message" required class="ta" id="Message" placeholder="Add a Brief Message Here....!" tabindex="7"></textarea>
<br>
<br>
<input type="submit" value="Submit" tabindex="8" class="submit"/>
</fieldset>
</form>
</div>


thanks
that's all
rshekhar21 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 06:33 PM.


Advertisement
Log in to turn off these ads.