• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

output a form to email

steven_d02

n00b
Joined
Feb 15, 2005
Messages
51
I'm trying to fix a problem with a webpage at work. Its a form that was built using frontpage that has gone bad and we no longer have the frontpage to fix it. The page collects data from the user and sends it to us in email, I tried to fix it by adding the line mailto:"email address" the old frontpage code referenced some shtml.dll file that somehow went missing. With the new line it triggers the antivirus program that some program is trying to use your email account to send data. How can I avoid having that pop up? Any clues as to what was in the .dll file? Thanks for your time.
 
the old code was:
post="../vti_bin/shtml.dll/path to webpage"

I changed it to:
post="malito:division email address"

Dose that help at all?
 
yeah that file had your mail form in it. It took everything that the user put in, and transmitted an email. Without that file, your whole mail form is going no where. I can give you a simple email form I wrote in php if need be, and you just post to the location of that file and it send the email.

The "mailto:" way your doing will just launch whatever you set your default email application on the users computer to open an email and put your "mailto:" address in the "to" field of the email message. You probally have some antivirus software catching that and thats why you got that message

good luck
 
since you're talking FrontPAge i'm assuming it's a Windows Server?

you can write a quick ASP page to handle the email instead using CDOSYS

Your form input page should have somthing like this:
Code:
<form name="frm" method="post" action="sendmail.asp">
Enter Your Name: <input type="text" name="thename" value="" /><br />
Message:<br />
<textarea name="themessage"></textarea>
<br />
<input type="submit" name="submit" value="Submit" />
</form>

..and sendmail.asp should look something like this
Code:
<%
'get the info submitted from your form input page
thename= Request.Form("thename")
themessage = Request.Form("themessage")

'create email object and set it's server configuration
Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

'configure email settings (usually no need to change this code)
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

'fire up the email object you created earlier
Set oMail.Configuration = oMailConfig

'create the email..the only part you should need to modify.
oMail.From = thename 'the name that was submitted
oMail.Sender = "Somebody@somewhere" 'you may or may not need this depending on whether the sent message needs to relay through an Exchange server..
oMail.To = "you@your-domain.com"
oMail.Subject = "You Got Mail!!!"
oMail.HTMLBody = themessage 'the message that was submitted

'send the email
oMail.Send

'clean up...
Set oMail = Nothing
Set oMailConfig = Nothing

%>

that ought to do it. Make sure the web server (i'm assuming IIS) has the SMTP module for IIS installed. Assuming it is installed and using default port 25, everything should work fine.
 
Thanks for the help, I'm going to try the asp stuff tomorrow at work, the only question I have is about the url for the schema stuff. The network I'm working on dosen't have access to the MS web site, dose that matter? Is there a place that I can download those schemas to my server and reference them locally? Again thanks for your help.
 
steven_d02 said:
Thanks for the help, I'm going to try the asp stuff tomorrow at work, the only question I have is about the url for the schema stuff. The network I'm working on dosen't have access to the MS web site, dose that matter? Is there a place that I can download those schemas to my server and reference them locally? Again thanks for your help.

nope, don't woprry about the schema stuff, it's used internally by CDOSYS and doesn't actually look for that URL on the web. In fact, you may be fine leaving out all this stuff
Code:
'configure email settings (usually no need to change this code)
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

'fire up the email object you created earlier
Set oMail.Configuration = oMailConfig

if your server uses all default settings
 
for the body part of the email how do I set it up to format multiple fields in the email? I was looking at the line:

oMail.HTMLBody = themessage 'the message that was submitted

how do I make HTMLBody contain multiple fields? Thanks again for your time. I'm really new to this asp stuff.
 
steven_d02 said:
for the body part of the email how do I set it up to format multiple fields in the email? I was looking at the line:

oMail.HTMLBody = themessage 'the message that was submitted

how do I make HTMLBody contain multiple fields? Thanks again for your time. I'm really new to this asp stuff.

you mean multiple fields from your form? as in
themessage = Request.Form("themessage")
morestuff = Request.Form("morestuff")

and you want to include both in the email message body?

you'd simply do this
oMail.HTMLBody = themessage & morestuff

or separate them int he body with a break
oMail.HTMLBody = themessage & "<br />" & morestuff
 
Yeah you need the scripting. I'm glad they are helping you. When you put in mail:to. You essentially took out the file the script needed to send out the mail.
 
so I can list as many fields as I want by just separating them with & "<br />" &. Dose the name of the asp file matter? I don't think that it would but I don't know a lot about asp. Also dose the form itself need a name? I didn't see that referenced anywhere in the example. And for the last question... the code that goes into the <form> tag is like this:

action="http://..../mail.asp"

should I use a relative path or absolute? Thanks again for all your help, I really appreciate it.
 
steven_d02 said:
so I can list as many fields as I want by just separating them with & "<br />" &.

yes..

Dose the name of the asp file matter? I don't think that it would but I don't know a lot about asp. Also dose the form itself need a name? I didn't see that referenced anywhere in the example.
no it doesn't matter, so long as the action attribute of the form uses the name. So if you define your form like this:
<form name="frmName" method="post" action="email.asp">

your asp file must be called email.asp

the form doesn't absolutely have to have a name, but it should have a name for the sake of proper coding.

And for the last question... the code that goes into the <form> tag is like this:

action="http://..../mail.asp"

should I use a relative path or absolute? Thanks again for all your help, I really appreciate it.

no it doesn't have to be absolute for the Response.Redirect to work.
 
Ok so I got this typed in:

<%
'get the info submitted from your form input page
name= Request.Form("name")
command = Request.Form("command")
email = Request.Form("email")
phone = Request.Form("phone")
remarks = Request.Form("remarks")

'create email object and set it's server configuration
Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

'configure email settings (usually no need to change this code)
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

'fire up the email object you created earlier
Set oMail.Configuration = oMailConfig

'create the email..the only part you should need to modify.
oMail.From = thename 'the name that was submitted
oMail.Sender = "Somebody@somewhere" 'you may or may not need this depending on whether the sent message needs to relay through an Exchange server..
oMail.To = "you@your-domain.com"
oMail.Subject = "You Got Mail!!!"
oMail.HTMLBody = name &"<br />"& command &"<br />"& email &"<br />"& phone &"<br />"& remarks

'send the email
oMail.Send

'clean up...
Set oMail = Nothing
Set oMailConfig = Nothing

%>

If I reference it with a relative path like this:

action="../../mail.asp"

it brings up a page that displays the code, but if I reference it absolute like this:

action="http:"//www..../mail.asp"

I get an http500 internal server error/. Is there something that I am missing? Should the local host be defined by the server IP? Thats about all that I could think of. Again thank you guys for your time and help.
 
what web server are you using? IIS5 or IIS6? If you don't know then if it's a win2k box, it's iis5, if win2k3, it's IIS6.

that fact that it's showing the asp code tells me the server is not configured to process ASP scripts. IIS6 by default does not have ASP script processing turned on.
 
we are running server 2000, is there a setting on the server that we have to turn on for it to process ASP? Thanks again for your time.
 
steven_d02 said:
we are running server 2000, is there a setting on the server that we have to turn on for it to process ASP? Thanks again for your time.

OK, ASP should be configured by default in Win2k. when you say it displays the code, you you mean it's showing the actual ASP code that you typed in? or is it showing an error message of some sort?

and where in your website is mail.asp relative to the web root folder?
 
when I say its posting the asp code I mean its showing exactly what I typed in if i use a relative path(../../internet_files/mail.asp) absolute path(http:www..../html/internet_files/mail.asp) gives a http500 internal server error. THe directories are set up like this:

root
--/html
--- /form
------ /form page
--- /internet_files
------ mail.asp

Again thanks for your time.
 
steven_d02 said:
when I say its posting the asp code I mean its showing exactly what I typed in if i use a relative path(../../internet_files/mail.asp) absolute path(http:www..../html/internet_files/mail.asp) gives a http500 internal server error. THe directories are set up like this:

root
--/html
--- /form
------ /form page
--- /internet_files
------ mail.asp

Again thanks for your time.

is "root" an actual folder name? if so is IIS configured to use that folder as it's Home directory? If both conditions are true, then try using action="/root/html/internet_files/mail.asp"
 
maw said:
is "root" an actual folder name? if so is IIS configured to use that folder as it's Home directory? If both conditions are true, then try using action="/root/html/internet_files/mail.asp"


should be something like this

C:\Inetpub\wwwroot
 
root is not a directory. we have a server with a decent amoutn of HD's and IIS is set to use the W drive as its wwwroot. there is no name for a folder that is root its the whole drive, so would I be able to use this code:

action="/html/internet_files/mail.asp"?

Should there be a folder called wwwroot? I have IIS installed on my Xp pro machine at home, what are the _vit_bin folders and all the _vti folders for? can you delete them or is there suppose to be things in there? Thanks so much for your time in helping me with this.
 
steven_d02 said:
root is not a directory. we have a server with a decent amoutn of HD's and IIS is set to use the W drive as its wwwroot. there is no name for a folder that is root its the whole drive, so would I be able to use this code:

action="/html/internet_files/mail.asp"?

Should there be a folder called wwwroot? I have IIS installed on my Xp pro machine at home, what are the _vit_bin folders and all the _vti folders for? can you delete them or is there suppose to be things in there? Thanks so much for your time in helping me with this.

no it's doesn't ahve to be called wwwroot. that's just what IIS names it by default
 
OK I tried using action"/html/internet_files/mail.asp" and it just showed the code again. There has to be a place to check the settigns for allowing asp code. Any idea on where to find this setting? Thanks yet again for your help.
 
steven_d02 said:
OK I tried using action"/html/internet_files/mail.asp" and it just showed the code again. There has to be a place to check the settigns for allowing asp code. Any idea on where to find this setting? Thanks yet again for your help.

OK, fire up IIS
right-click your website Properties - Home Directory Tab
Make sure Execute Permissions has "Script Only" selected
Click on the "Configuration" button, then "Mappings" tab
Look for the extension .ASP, is that extension in there? If so, the executable path should say something like C:\Windows\system32\inetserv\asp.dll. Also Click on "Edit" and make sure the "Script Engine" and Verify that file exists" boxes are both checked.

If the .asp extension isn't listed at all, then Click on "Add", and in the "Executable" box type the above path, in the "Extension" box, type .asp, make sure the "Script Engine" and "Verify that file exists" boxes are checked.
 
Ok so I haven't had a chance to check out the server setting yet but I had another quick question. Is there a good book out there that covers both asp and asp.net? THe server that we are running now dosen't support .NET but they are expected to add that functionality in the future. Thanks agian for all your help.
 
Ok so I ckecked the settings on the web server and the "verify file exists" box wasn't checked, so I checked it and nothing changed. I still get the same errors, any idea what could be the problem? Is there another way to do this? If so its gotta be something I can make work with out installing anything else. Again thanks for your help.
 
Back
Top