Adobe Dreamweaver Forums



Last 10 THreads :         CS4 crashes (Last Post : kadavila - Replies : 11 - Views : 12 )           »          add number to global variable? (Last Post : twistedpancreas - Replies : 0 - Views : 1 )           »          Accessing events from externally loaded swf file (Last Post : LuigiL - Replies : 2 - Views : 69 )           »          Re: Unloading SWFLoader... BUG??! (Last Post : LuigiL - Replies : 1 - Views : 2 )           »          Problem with navigateToURL to a certain frame (Last Post : Ibsie - Replies : 0 - Views : 1 )           »          html view - how to wrap the text (Last Post : lmckh - Replies : 1 - Views : 2 )           »          Help! Prob with CSS display (Last Post : hnajskmei - Replies : 0 - Views : 1 )           »          DW help urgently needed, lost my connection to site (Last Post : Ronnie MacGregor - Replies : 11 - Views : 12 )           »          Connecting to a Database (Last Post : Ronnie MacGregor - Replies : 11 - Views : 12 )           »          application.cfm/webservice (Last Post : BKBK - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver General
 
Tags: , ,



Reply
  #1 (permalink)  
Old 09-03-2008, 04:40 AM
daniel@golombgroup.com
 
Posts: n/a
Diggs:
Default PHP Email 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 ?>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-03-2008, 07:10 AM
kim
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

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

Reply With Quote
  #3 (permalink)  
Old 09-03-2008, 04:42 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

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
> 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 ?>
>


Reply With Quote


  #4 (permalink)  
Old 09-03-2008, 08:02 PM
Michael Fesser
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

.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
Reply With Quote
  #5 (permalink)  
Old 09-03-2008, 08:42 PM
daniel@golombgroup.com
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

Kim, the formbuilder doesn't work...

After I enter my info, It says "Object doesn't support this property or method."
Reply With Quote
  #6 (permalink)  
Old 09-03-2008, 10:17 PM
kim
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

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

Reply With Quote


  #7 (permalink)  
Old 09-03-2008, 11:42 PM
daniel@golombgroup.com
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

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.

Reply With Quote
  #8 (permalink)  
Old 09-04-2008, 07:16 AM
kim
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

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

Reply With Quote
  #9 (permalink)  
Old 09-04-2008, 10:06 AM
malcster2
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

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

Reply With Quote


  #10 (permalink)  
Old 09-04-2008, 10:06 AM
malcster2
 
Posts: n/a
Diggs:
Default Re: PHP Email Setup

oh, and a submit button
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 01:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk