PDA

View Full Version : Any One Help The asp code



sreenivasulareddy
12-13-2006, 12:08 PM
hi Friends
i need email this page(tell to friend) asp code Bez i no for normal feed back form code but idont how to get send the url plz help me

this is my html form
--------------------------------------------------------------------
<form name="contact" method="POST" action="sendurl.asp" onSubmit="return valider()">
<table width="500" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="214" align="right">
Your Name: </td>
<td ><input type="text" name="visitor" size="25"></td>
</tr>
<tr>
<td align="right">Your Email:</td>
<td><input type="text" name="visitormail" size="25"></td>
</tr>
<tr>
<td align="right">Friend's Name: </td>
<td><input type="text" name="friend" size="25"></td>
</tr>
<tr>
<td align="right">Friend's Email: </td>
<td><input type="text" name="friendmail" size="25"></td>
</tr>
<tr>
<td align="right">Your Message:<br> <br> </td>
<td><textarea name=notes rows=4 cols=27></textarea></td>
</tr>
<tr align="center">
<td height="30" colspan="2">
<input name="Submit" type="submit" value="Send URL">
</td>
</tr>
</table>
</form>
----------------------------------------------------------------------

baleric
12-15-2006, 01:49 AM
hello,
add this code to the sendurl.asp page


<%
' Email Form '

Dim iMsg,tVisitor, tvisitoremail, tfriend, tfriendmail, tnotes, thedate, thetime
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")

tVisitor = request.Form("visitor")
tvisitoremail = request.Form("visitormail")
tfriend = request.Form("friend")
tfriendmail = request.Form("friendmail")
tnotes = request.Form("notes")
thedate = date()
thetime = time()

Dim Flds
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds( _
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") _
= "c:\inetpub\mailroot\pickup"
Flds.Update

Set iMsg.Configuration = iConf

'SEND EMAIL TO
iMsg.To = tfriendmail
''''''''''''''''''''''''''''''''''''''''
'SEND EMAIL FROM
iMsg.From = "email@domain.com"
''''''''''''''''''''''''''''''''''''''''
'MESSAGE SUBJECT
iMsg.Subject = "Message Subject"
''''''''''''''''''''''''''''''''''''''''
iMsg.htmlBody = "<strong> Visitor: </strong>" & Trim(tVisitor) & vbCrLf _
& "<br><strong>Visitor's Email: </strong>" & Trim(tvisitoremail) & vbCrLf _
& "<br><strong>Friends Name: </strong>" & Trim(tfreind) & vbCrLf _
& "<br><strong>Friends Email: </strong>" & Trim(tfreindmail) & vbCrLf _
& "<br><strong>Message: </strong>" & Trim(tNotes) & vbCrLf _
& "<br><strong>Time: </strong>" & Trim(thetime) & vbCrLf _
& "<br><strong>Date: </strong>" & Trim(theDate) & vbCrLf
iMsg.Send

response.redirect("otherpage.asp")

%>

let me know how it went

Cheers