![]() |
![]() |
||||||
|
|||||||
| Tags: email, php, setup |
![]() |
|
|||
|
I am setting up my first php email code into a dreamweaver page, but as of
right now the form wont mail. Also the very top of my email page has a php logo followed by Thank you... Your message has been sent. php logo. Any help would be much appreciated. My code looks like this: <? if($_REQUEST[message]){ //This checks if the form has been submitted or not $to="info@mysite.com"; // Modify the email address to be the email address you want to receive the email via your form. $from=$_REQUEST[emailaddress]; // The from variable is set by the form field that was sent $subject="Contact From Your Website"; // This is the subject of the message being sent to you from your form $message=$from."- ".$_REQUEST[message]; // This is the message to be sent to you mail($to,$subject,$message); // This is the actual sending of the email using PHP's mail function http://us.php.net/manual/en/function.mail.php $confirmto=$_REQUEST[emailaddress]; // The email address we'll send a confirmation to $confirmsubject="Your Confirmation"; // Confirmation Email Subject $confirmfrom="info@mysite.com"; // Your confirming emailer address $confirmmessage="Thank you for your email."; // Message to send to confirm //mail($confirmto,$confirmsubject,$confirmmessage) ; // Confirmation - uncomment this line to use it //After the message is sent we will display a thank you message ?> Thank you... Your message has been sent. <? } else { // If the form has not been submitted show the form ?> |
| Sponsored Links |
|
|||
|
Perhaps try to build a new one http://geekministry.com/formbuilder/
daniel@golombgroup.com skrev: > I am setting up my first php email code into a dreamweaver page, but as of > right now the form wont mail. > Also the very top of my email page has a php logo followed by Thank you... > Your message has been sent. php logo. Any help would be much appreciated. > > My code looks like this: > > <? > if($_REQUEST[message]){ //This checks if the form has been submitted or not > > $to="info@mysite.com"; // Modify the email address to be the email address > you want to receive the email via your form. > $from=$_REQUEST[emailaddress]; // The from variable is set by the form > field that was sent > $subject="Contact From Your Website"; // This is the subject of the > message being sent to you from your form > $message=$from."- ".$_REQUEST[message]; // This is the message to be sent > to you > mail($to,$subject,$message); // This is the actual sending of the email > using PHP's mail function http://us.php.net/manual/en/function.mail.php > > $confirmto=$_REQUEST[emailaddress]; // The email address we'll send a > confirmation to > $confirmsubject="Your Confirmation"; // Confirmation Email Subject > $confirmfrom="info@mysite.com"; // Your confirming emailer address > $confirmmessage="Thank you for your email."; // Message to send to confirm > //mail($confirmto,$confirmsubject,$confirmmessage) ; // Confirmation - > uncomment this line to use it > > //After the message is sent we will display a thank you message > ?> > Thank you... Your message has been sent. > > <? } else { // If the form has not been submitted show the form ?> > > -- Kim --------------------------- http://www.geekministry.com |
|
|||
|
if($_REQUEST['message']){
and so on. You need to quote your field names. -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "daniel@golombgroup.com" <webforumsuser@macromedia.com> wrote in message news:g9kv5j$s5n$1@forums.macromedia.com... >I am setting up my first php email code into a dreamweaver page, but as of > right now the form wont mail. > Also the very top of my email page has a php logo followed by Thank you... > Your message has been sent. php logo. Any help would be much appreciated. > > My code looks like this: > > <? > if($_REQUEST[message]){ //This checks if the form has been submitted or > not > > $to="info@mysite.com"; // Modify the email address to be the email > address > you want to receive the email via your form. > $from=$_REQUEST[emailaddress]; // The from variable is set by the form > field that was sent > $subject="Contact From Your Website"; // This is the subject of the > message being sent to you from your form > $message=$from."- ".$_REQUEST[message]; // This is the message to be > sent > to you > mail($to,$subject,$message); // This is the actual sending of the > using PHP's mail function http://us.php.net/manual/en/function.mail.php > > $confirmto=$_REQUEST[emailaddress]; // The email address we'll send a > confirmation to > $confirmsubject="Your Confirmation"; // Confirmation Email Subject > $confirmfrom="info@mysite.com"; // Your confirming emailer address > $confirmmessage="Thank you for your email."; // Message to send to > confirm > //mail($confirmto,$confirmsubject,$confirmmessage) ; // Confirmation - > uncomment this line to use it > > //After the message is sent we will display a thank you message > ?> > Thank you... Your message has been sent. > > <? } else { // If the form has not been submitted show the form ?> > |
|
|||
|
.oO(Murray *ACE*)
>if($_REQUEST['message']){ > >and so on. You need to quote your field names. Correct. And with a correctly configured error reporting PHP would have already complained about them. On a development machine these settings in the php.ini are not only recommended, but a must: error_reporting = E_ALL|E_STRICT display_errors = on Additionally it's not the best idea to use $_REQUEST, since it contains data from three different sources. Use $_POST or $_GET, dependent on the used method to submit the form. And finally there are some real problems in the PHP code. The mail server might reject the message, because there's no valid From: defined and the script itself is vulnerable to header injection. Micha |
|
|||
|
Hi Daniel,
I'm sorry to hear you experience problems. I've just built a form just to test it and I can not replicate your problem. Could you please include a little more info like which OS, browser and on which page does the error occur? Thanks > Kim, the formbuilder doesn't work... > > After I enter my info, It says "Object doesn't support this property or method." > -- Kim --------------------------- http://www.geekministry.com |
|
|||
|
Im using Windows Vista on my PC. I'm also using Internet Explorer that came
with Vista. After clicking the link to your page, I clicked "Try It Out" link. On the form builder page, I can enter all my info, but when I try to download "this folder" for Spamtrap Protection Level, it takes me to "This Page Cannot Be Found." Then, if I select Honeypot or None, and click the Green Arrow, I get the error message. |
|
|||
|
Hi Daniel,
I don't have Vista so I can't test that. But I've tried to build a form with the following browsers... IE6,8, Google crome, FF 2 and 3, Opera 9.5x, Safari for win... and I can't replicate the error. Anyway... there should be no reason to use spamtrap script (the download) over the other... so that is not the problem. Another question if you don't mind... are you typing in a "normal" email address for recipient and named the forms page something like this... "contact.php" (without the quotes)? Please let me know. Thanks Kim daniel@golombgroup.com skrev: > Im using Windows Vista on my PC. I'm also using Internet Explorer that came > with Vista. > > After clicking the link to your page, I clicked "Try It Out" link. On the > form builder page, I can enter all my info, but when I try to download "this > folder" for Spamtrap Protection Level, it takes me to "This Page Cannot Be > Found." > > Then, if I select Honeypot or None, and click the Green Arrow, I get the error > message. > > -- Kim --------------------------- http://www.geekministry.com |
|
|||
|
daniel, this works for me
<?php if(isset($_POST['submit'])) { $varbreak = "\n\n"; mail('contact@youremailaddress', 'Subject: '.$_POST['subject'], $_POST['message'].$varbreak.$_POST['name'], $_POST['email']); unset($_POST['submit']); } ?> all you have got to do is set a form with the relevant id's, ie, subject, message, name and email |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise