Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar

Submitting survey to e-mail address


  • Please log in to reply
4 replies to this topic

#1 MarkBeepBeep

MarkBeepBeep

  •  Avatar image
  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:01:09 AM

Posted 19 August 2023 - 01:38 PM

I have a survey in .html code that used to work nicely on my website.

 

After the survey was completed the visitor would click the 'Submit button' and the survey would be

sent to my e-mail address.

 

Something changed a number of years ago and the site that used to take care of the survey submission to

my e-mail address stopped working.

 

So now after the survey is completed, it can't be submitted to my e-mail address.

 

Can someone help me out here with some code that would take the survey responses

and send them to my e-mail address when they clicked the 'Submit button'?

 

 



BC AdBot (Login to Remove)

 


#2 MarkBeepBeep

MarkBeepBeep
  • Topic Starter

  •  Avatar image
  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:01:09 AM

Posted 21 October 2023 - 02:44 PM

Bump...

 

The only thing I see on the net are companies with their own survey software selling their services.

 

As I mentioned above, I already have my survey in .html code.

I just need a button users can click on to send the completed survey to an e-mail address.

 

Does anyone here know how to do this?



#3 ctigga

ctigga

  •  Avatar image
  • Members
  • 204 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:01:09 AM

Posted 21 October 2023 - 05:27 PM

Google for "post email form" (without quotes)

Sending an email from a webpage typically involves using html's FORM tag with a POST action to a script (or other resource) on your server. The server then sends the email based on the form content that was submitted.

(Other alternatives include "mailto:", websockets, ... but I suspect you were previously using HTML FORM POST)

#4 MarkBeepBeep

MarkBeepBeep
  • Topic Starter

  •  Avatar image
  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:01:09 AM

Posted 21 October 2023 - 06:47 PM

Google for "post email form" (without quotes)

Sending an email from a webpage typically involves using html's FORM tag with a POST action to a script (or other resource) on your server. The server then sends the email based on the form content that was submitted.

(Other alternatives include "mailto:", websockets, ... but I suspect you were previously using HTML FORM POST)

Thanks for helping!

I just checked the code (I didn't write it).

This is what I have:

 

 <form action="http://mywebsite.com/cgi/formmail" method = "POST">
the next code (the survey) then finally ends with
   </form>

 

So you were correct about using a 'form' tag.

 

Does this mean that my server was previously allowing its software to send the form result to the e-mail mentioned in the code,

but that they decided to terminate the service?

Or was another software company involved with the form?

 

I'm just trying to figure out the best way to proceed.

 


Edited by MarkBeepBeep, 21 October 2023 - 06:47 PM.


#5 ctigga

ctigga

  •  Avatar image
  • Members
  • 204 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:01:09 AM

Posted 21 October 2023 - 07:56 PM

 <form action="http://mywebsite.com/cgi/formmail" method = "POST">

the next code (the survey) then finally ends with
   </form>

 

Yes, the http://mywebsite.com/cgi/formmail reference is the resource that all the form data (the survery responses) will be sent to when the user clicks the Submit button.

The cgi reference in that address stands for "common gateway interface", which was a common way to handle form processing in the earlier days of the Internet. CGI can still be used, but has largely been replaced by newer server-side languages (PHP, Ruby, Python, ...) which are typically faster to execute and have smaller memory requirements. It can really make a huge difference on busy hosting servers.

 

First/easy thing I would recommend trying:  change http://mywebsite.com/cgi/formmail to https://mywebsite.com/cgi/formmail

(Note the "s" added to http)

 

http was previously the standard for websites, but now https is the standard.

If you host blocked http (port 80) then trying to access the script wouldn't work. Changing to https may be the only change you need.

 

 

Does this mean that my server was previously allowing its software to send the form result to the e-mail mentioned in the code,

but that they decided to terminate the service?

Or was another software company involved with the form?

 

I'm just trying to figure out the best way to proceed.

 

Assuming changing the FORM action to use an https:// address doesn't solve the problem, you may need to contact your host.

They likely discontinued support for cgi scripts.  They may be able to provide you with an alternative address that offers the same support (using a script that they now prefer)

 

Alternatively, you could make your own script to handle the processing.  You'd upload the (e.g. PHP) script to your host and then reference your new script in the html FORM action.

Here's a simple example, but you should be able to find all sorts of examples on Google:

https://blog.getform.io/how-to-create-an-html-form-that-sends-you-an-email/

(There is a section that talks about emailing via the script)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users