Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 08-22-2004, 07:22 AM   #1
Beta Member
Join Date: Aug 2004
Posts: 4
Default asp/jmail?

I am trying to use an asp/jmail script on a form. When i place the following script in the form.asp at the very top of the document it works. However as this script remains in the actual page the form resides, it may cause the recipient to get spam mail. I tried to put the below script into a seperate asp file and make the form action that script. It executes the script fine and sends the user to the redirect page, making it appear all is well, however the email is never recieved by te recipient. Does anyone know why this occurs?

The script is as follows:


if request.form("ranonce") = "true" then

Name = request.form("Name")
Email = request.form("E-mail")
Telephone = request.form("Telephone")
Address = request.form("Address")
Country = request.form("Country")
Postalcode = request.form("Postalcode")
Position = request.form("Position")
Organisation = request.form("Organisation")
Other = request.form("Other")
checkbox1 = request.form("checkbox1")
checkbox2 = request.form("checkbox2")

message = ""
message = name + " has made an enquiry on mydomain.com " & vbcrlf &vbcrlf

message = message + "Name: "
message = message + Name &vbcrlf
message = message + "Position: "
message = message + Position &vbcrlf
message = message + "Organisation: "
message = message + Organisation &vbcrlf
message = message + "Address: "
message = message + Address &vbcrlf
message = message + "Country: "
message = message + Country &vbcrlf
message = message + "Postcode: "
message = message + Postalcode &vbcrlf &vbcrlf
message = message + "Telephone: "
message = message + Telephone &vbcrlf
message = message + "E-Mail: "
message = message + Email &vbcrlf &vbcrlf

message = message + name + " would like more information on the following material: " & vbcrlf &vbcrlf

message = message + "checkbox1: "
message = message + checkbox1 &vbcrlf
message = message + "checkbox1: "
message = message + checkbox2 &vbcrlf
message = message + "checkbox2: "

set JMail = CreateObject("JMail.SMTPMAIL")

JMail.ServerAddress = "mail.myserver.co.uk"
JMail.Sender = "formail@mydomain.com"
JMail.SenderName = "Form Name"
JMail.AddRecipient "myemail@mydomain.com"
JMail.Priority = 1
JMail.Subject = "email subject"
JMail.Body = message
on error resume next
on error goto 0
set JMail = nothing
End if

any help would be appreciated.

kfc04 is offline   Reply With Quote
Old 08-23-2004, 06:08 AM   #2
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 8,098
Default Re: asp/jmail?

if you have ASP why don't you use the CDOnts object for sending mail?

I cant think why this doesn't work, though I think you are right to be concerned with receiev4eing spam from email spiders that will get the address from the page. You could try storing the email address in a database, then you'd only get an address after the mail had been run once. (which a spider would not do)

Another thing you should be aware of is ASP happens server side, so you could just have the message posted to an email script, then all the addresses would be kept server side and the recipient need never know your address.
root is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off

All times are GMT -5. The time now is 07:21 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0