We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Dreamweaver MX 2004 Submit form, any way to use remote script to do mailform function?

2E0AQU
2E0AQU asked
on
Medium Priority
255 Views
Last Modified: 2012-05-07
Hi
Trying to get some students to add a form to a basic web site (only a couple of simple questions) , i understand that we cant send the form without some server side help but wondered if its possible to use a mailform function from some other website/server not ours.
anyone any ideas how we could get a submit form button working with out our server having to do anything?
or is it possible to have the contents of the form passed into a email that is sent from the clients own email account (outlook etc) ??
Hope you can help
Paul
Comment
Watch Question

Jason C. LevineDon't talk to me.
CERTIFIED EXPERT

Commented:
Hi Paul,

>> if its possible to use a mailform function from some other website/server not ours.

Yes.  All you would need to do is find a remotely hosted form to email script and point the form action to that URL.

>> or is it possible to have the contents of the form passed into a email that is sent from the clients own email account (outlook etc) ??

You could attempt to set the form action to "mailto:account@domain.com" but a lot of the more modern browsers will not process it.  You are better off going with the remotely hosted solution above.

Commented:
setup a new server as a test web server either, virtualy or an old pc, and setup xampp or install linux and apache etc then your students can use that with the mail script

if you go down the apache route you can install pear mail which will act as a mail server and use that as a test web server
see
http://pear.php.net/package/Mail/

Author

Commented:
Hi Jason

Thanks for the reply, it sounds nice and easy that way but having just spent the last hour searching the web for a free to user link and having no luck im not so sure, i dont suppose you know of any links for such a script.?
regards
Paul

Commented:
see my comments as well

use pear mail
and heres a script to read all the elements on the form
it works I am using it on a current web project
it will work if the server has a mail component installed and as I said if you install apache on a old pc or a virtual pc you can install pear mail to act as a mail server to parse the php script
<?php
//--------------------------Set these paramaters--------------------------
 
// Subject of email sent to you.
$subject = 'form from Oswald Inns'; 
 
// Your email address. This is where the form information will be sent. 
$emailadd = 'ian@gbpost.com'; 
$emailaddto = 'ian@gbpost.com';  
$fromadd = 'ian@ian.no1net.co.uk'; 
// Where to redirect after form is processed. 
// $url = '../thankyou.html'; 
$url = 'thankyou.html';
// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0'; 
 
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n"; 
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty. Click the back button to return to the form";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j; 
 
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
 
 
 
 
mail($emailadd, $subject, $text, "From: $fromadd", "-f".$fromadd );
mail($emailaddto, $subject, $text, "From: $fromadd", "-f".$fromadd);
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Open in new window

Commented:
see my comments as well

use pear mail
and heres a script to read all the elements on the form
it works I am using it on a current web project
it will work if the server has a mail component installed and as I said if you install apache on a old pc or a virtual pc you can install pear mail to act as a mail server to parse the php script
<?php
//--------------------------Set these paramaters--------------------------
 
// Subject of email sent to you.
$subject = 'form from Oswald Inns'; 
 
// Your email address. This is where the form information will be sent. 
$emailadd = 'ian@gbpost.com'; 
$emailaddto = 'ian@gbpost.com';  
$fromadd = 'ian@ian.no1net.co.uk'; 
// Where to redirect after form is processed. 
// $url = '../thankyou.html'; 
$url = 'thankyou.html';
// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0'; 
 
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n"; 
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty. Click the back button to return to the form";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j; 
 
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
 
 
 
 
mail($emailadd, $subject, $text, "From: $fromadd", "-f".$fromadd );
mail($emailaddto, $subject, $text, "From: $fromadd", "-f".$fromadd);
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Open in new window

Don't talk to me.
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks Jason and thanks Ian too,
Jasons links , the first one on the list , works like a charm. I have just tryed it with a simple form made in dreamweaver and it went straight to the emal address i wanted so many thanks for the help.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.