Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 31st Jul 2009, 10:20 AM   #1
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Hi all

I hope you can help me. I set up a simple form on my website, only fields for name and e-mail and a send button. I am using Joomla, and I added the folowing code in the source field of an article. (Should it be here or somewhere else?)

<form action="sendmail.php" method="post" name="Form">
<p style="text-align: center">Name&nbsp;&nbsp;&nbsp; <input name="Name" type="text" /></p>
<p style="text-align: center">E-mail&nbsp;&nbsp; <input name="E-mail" type="text" /></p>
<p style="text-align: center"><input type="submit" name="Send" value="Send" /></p>
</form>
<?php
$Name = $_REQUEST['Name'] ;
$E-mail = $_REQUEST['E-mail'] ;
mail( "me@mysite.com", "Feedback Form Results",
$message, "From: $Name" );
header( "Location: http://www.redirecthere.com" );
?>


I made sure sendmail is selected in the global configuration, and the sendmail path is given as /usr/sbin/sendmail.

Now when I enter values and click send on my site I get the following message: "The page cannot be found". The URL of this page is http://www.mysite.com/sendmail.php. What is wrong? I know this is a simple form, but I want to test the sendmail function before I write a more complicated form script.

Thanks
Cruiser is offline  
Unread 31st Jul 2009, 02:51 PM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2008
Location: Escondido, CA. Becase San Marcos just wasn't hot enough.
Posts: 496
Thanks: 34
Thanked 56 Times in 55 Posts
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Does the sendmail.php file actually exist in the root folder of your site?
Any differences in capitalization between the file name & the reference to it in your code?
If you manually type in the address to the file in a browser, what do you get?

The sendmail.php file has to exist where your form is looking for it. In this case, since you aren't specifying the full URL (http:\\www...sendmail.php), the server is going to be looking for it in the same directory as the page your form is on. If it's in another location, either move it, or fix the location in the form: <form action="sendmail.php"...>
Aronya is offline  
The Following User Says Thank You to Aronya For This Useful Post:
Unread 31st Jul 2009, 07:42 PM   #3
Gleb
War Room Member
 
gesman's Avatar
 
Join Date: 2008
Location: Ottawa, Canada
Posts: 904
Thanks: 9
Thanked 135 Times in 96 Posts
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

$E-mail - invalid variable name.
Make it $e_mail


Gleb

gesman is offline  
The Following User Says Thank You to gesman For This Useful Post:
Unread 1st Aug 2009, 03:45 AM   #4
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Okay I'll give it a try.

I just want to make sure (I am a day into coding...okay). I am using Joomla, and in the editor for articles there is a button to see the code, must I put both the HTML and PHP code there? In the global configuration Joomla gives the path of sendmail as I said above...should I change it somehow to the path of the article?

Thanks for your time!
Cruiser is offline  
Unread 1st Aug 2009, 04:14 AM   #5
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

It still don't work. I corrected the variables in the code. In the global configuration of Joomla the path of sendmail is given as /usr/sbin/sendmail (just like that - it is the default path - I didn't change anything).

What I noticed is, when I save the article and open it again, the name of the form is changed to [object] when you click on form properties in the editor. However it still remains form in the code. I changed the name of the form to [object] in the code, and it still doesn't work.

When I submit a name and e-mail I get a error that the page cannot be displayed. The URL of this page is www.mysite.com/sendmail.php!

Please help! I am so frustrated, I am struggeling for a week now!
Cruiser is offline  
Unread 1st Aug 2009, 07:48 AM   #6
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Okay I think I know what is wrong. I saw that I must upload a file called sendmail.php somewhere via my ftp directory. Can someone please send me a link to such code and where I must put it?
Cruiser is offline  
Unread 1st Aug 2009, 11:39 AM   #7
HyperActive Warrior
War Room Member
 
Join Date: 2008
Location: Escondido, CA. Becase San Marcos just wasn't hot enough.
Posts: 496
Thanks: 34
Thanked 56 Times in 55 Posts
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Originally Posted by Cruiser View Post

Okay I think I know what is wrong. I saw that I must upload a file called sendmail.php somewhere via my ftp directory. Can someone please send me a link to such code and where I must put it?
Okay. What part of my post did you not understand?
Aronya is offline  
Unread 2nd Aug 2009, 02:08 AM   #8
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Sorry...I am new to all this stuff! I think I did everything right now. When I click on send I get the following message:

Warning: Cannot modify header information - headers already sent by (output started at /home/voxvoxis/public_html/sendmail.php:2) in /home/voxvoxis/public_html/sendmail.php on line 8
Cruiser is offline  
Unread 2nd Aug 2009, 02:10 AM   #9
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

Just another thing, when I build the form in Joomla, I name the form as "form". Then when I add the text boxes an the button, the form name automatically change to [object]. I have tried to rename it back to form but it doesn't accept this change. Why is this happening?
Cruiser is offline  
Unread 2nd Aug 2009, 02:19 AM   #10
Active Warrior
 
Join Date: 2009
Location: South Africa
Posts: 66
Thanks: 17
Thanked 1 Time in 1 Post
Default
Re: Please help me with sendmail!
Share on: 
fb share twitter share gplus share more share

It works!!!
Thanks everyone!!
Cruiser is offline  
Closed Thread


Bookmarks

Tags
sendmail


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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




All times are GMT -6. The time now is 01:47 PM.