Results 1 to 2 of 2

Thread: sending email problem

  1. #1
    Join Date
    Feb 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default sending email problem

    hi guys,

    can anyone resolve this problem of creating a contact page using asp....

    Code:
    <html>
    <body>
    <form action="realmail.asp" method="post" id="form1" name="form1">
    
    	<table width="300px" height="auto" border="0">
    	
    		<tr>
    		<td>Name</td>
    		<td><input type="text" id="name" name="name"></td>
    		</tr>
    		
    		
    		<tr>
    		<td>Age</td>
    		<td><input type="text" id="age" name="age"></td>
    		</tr>
    		
    		
    		<tr>
    		<td>Sex</td>
    		<td><input type="text" id="sex" name="sex"></td>
    		</tr>
    		
    		<tr>
    		<td>Address</td>
    		<td><textarea id="msg" name="msg"></textarea></td>
    		</tr>
    		
    		
    		
    		<tr>
    		<td>Telephone</td>
    		<td><input type="text" id="tele" name="tele"></td>
    		</tr>
    		
    		
    		
    		<tr>
    		<td>Email</td>
    		<td><input type="text" id="email" name="email"></td>
    		</tr>
    		
    		
    		<tr>
    		<td>&nbsp;</td>
    		<td>
    		<input type="submit" name="Submit" value="Submit">
    		</td>
    		</tr>
    
    		
    		
    	</table>
    
    </form>
    </body>
    </html>


    Code:
    <html>
     
    <body  text="#000066" bgcolor="#FFFFFF" >
    <%
    dim name
    dim age
    dim sex
    dim msg
    dim tele
    dim email
    
    name=trim(request.form("name"))
    age=trim(request.form("age"))
    sex=trim(request.form("sex"))
    msg=trim(request.form("msg"))
    tele=trim(request.form("tele"))
    email=trim(request.form("email"))
    
    
    
     message= " <div align='center'><center><table border='1' width='80%'> "
     message=message + "<tr><td width='30%' align='left'>Name :</td>"
     message=message + "<td width='50%' align='center'><p align='left'>"&name&"</td></tr>"
     message=message + "<tr><td width='30%' align='left'>Age :</td>"
     message=message + "<td width='50%' align='center'><p align='left'>"&age&"</td></tr>"
     message=message + "<tr><td width='30%' align='left'>Age :</td>"
     message=message + "<td width='50%' align='center'><p align='left'>"&sex&"</td></tr>" 
    	 message=message + "<tr><td width='30%' align='left'>Age :</td>"
         message=message + "<td width='50%' align='center'><p align='left'>"&msg&"</td></tr>"
     message=message + "<tr><td width='30%' align='left'>Age :</td>"
         message=message + "<td width='50%' align='center'><p align='left'>"&tele&"</td></tr>" 
    	 message=message + "<tr><td width='30%' align='left'>Age :</td>"
         message=message + "<td width='50%' align='center'><p align='left'>"&email&"</td></tr>"
     message=message + "</table></center></div>"
     
     dim objMail
     
     Set objMail = Server.CreateObject("Persits.MailSender")			
    		If sFormat = "text" Then
    		objMail.Ishtml = False
    		Else
    		objMail.Ishtml = True
    		End If
    		If sImportance = "high" Then
    		objMail.Priority = 1
    		ElseIf sImportance = "low" Then
    		objMail.Priority = 5
    		Else
    		objMail.Priority = 3
    		End If
    		
    		
    		objMail.Host = sMailServer
    		objMail.From = email
    		objMail.FromName = email
    		objMail.AddAddress "xx@xxx.com"
    		objMail.Subject = "Contact Request From Our Site"
    		objMail.Body =  message
    		objMail.Send
    		
    		
    		
    	   response.write "<center><b text='#000066'>We have received your Request  !!!<b><center><br>"
       	   response.write "<center><b text='#000066'>We will contact you soon !!!<b><center><br>"
    	   response.write "<center><b text='#000066'>Thank You !!!<b><center><br>"
    	   
    %>
    </body>
    </html>

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    What's wrong with it?
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •