Jump to content

why no data on email?


hoachen

Recommended Posts

This is very basic to setup the data that send to my email from what I read from the internet. This is my first asp project and never learn before. Please give your advice. This form and data does not go through my email mean i didn't receive anything! What should I change in order to receive data that user filled?Here is the ASP Code and the html code at below<%Dim bodyContent Dim objCDOMail Dim sentTo Dim userEmail sentTo= "aaa@hotmail.com"userEmail = Request.Form("email")bodyContent = bodyContent& "<br><b>First Name: </b>" & Request.Form("firstName") bodyContent = bodyContent& "<br><b>Last Name: </b>" & Request.Form("lastName")bodyContent = bodyContent& "<br><b>Title: </b>" & Request.Form("title")bodyContent = bodyContent& "<br><b>Company Name: </b>" & Request.Form("company")Set objCDOMail = Server.CreateObject("CDONTS.NewMail")objCDOMail.From = Request.Form("firstName") & " " & Request.Form("lastName") & " <" & userEmail & ">"objCDOMail.To = sendToobjCDOMail.Subject = "contact form"objCDOMail.BodyFormat = 0objCDOMail.MailFormat = 0objCDOMail.Body = bodyContent objCDOMail.Importance = 1 objCDOMail.SendSet objCDOMail = Nothing%>HTML Code<form method="post" name="contact" action="contact.asp"><table> <tr><td>First Name: <input name="firstName"></td></tr> <tr><td>Last Name: <input name="lastName"></td></tr> <tr><td>Title: <input name="title" /></td> </tr> <tr><td>Company Name: <input name="company"></td></tr> <tr><td><input type="reset" value="Reset" name="reset"/> <input name="submit" type="submit" value="Submit" /></td></tr> </table></form>

Link to comment
Share on other sites

Code Looks pretty much fine.To check test with simple direct mail id's<% Set Mail=Server.CreateObject(“CDONTS.NewMail”) Mail.To=”me@mydomain.com” Mail.From=”testing-my@SP-Script.com” Mail.Subject=”Just testing my script” Mail.Body=”Hey! I am sending this email through an ASP Page and guess what? I haven’t learnt much yet, but know that ASP is very powerful.” Mail.Send Set Mail=nothing %>HTH

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...