Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 07-31-2009, 11:20 AM   #1
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Please help me with sendmail!

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

Quote:
<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   Reply With Quote
Old 07-31-2009, 03:51 PM   #2
Advanced Warrior
War Room Member
 
Join Date: Feb 2008
Location: Escondido, CA. Becase San Marcos just wasn't hot enough.
Posts: 510
Thanks: 35
Thanked 56 Times in 55 Posts
Default Re: Please help me with sendmail!

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   Reply With Quote
Old 07-31-2009, 08:42 PM   #3
Gleb
War Room Member
 
MemberWing's Avatar
 
Join Date: Dec 2008
Location: Ottawa, Canada
Posts: 845
Thanks: 10
Thanked 104 Times in 85 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to MemberWing
Default Re: Please help me with sendmail!

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


Gleb

MemberWing is offline   Reply With Quote
Old 08-01-2009, 04:45 AM   #4
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: Please help me with sendmail!

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   Reply With Quote
Old 08-01-2009, 05:14 AM   #5
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: Please help me with sendmail!

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   Reply With Quote
Old 08-01-2009, 08:48 AM   #6
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: Please help me with sendmail!

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   Reply With Quote
Old 08-01-2009, 12:39 PM   #7
Advanced Warrior
War Room Member
 
Join Date: Feb 2008
Location: Escondido, CA. Becase San Marcos just wasn't hot enough.
Posts: 510
Thanks: 35
Thanked 56 Times in 55 Posts
Default Re: Please help me with sendmail!

Quote:
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   Reply With Quote
Old 08-02-2009, 03:08 AM   #8
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: Please help me with sendmail!

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:

Quote:
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   Reply With Quote
Old 08-02-2009, 03:10 AM   #9
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: Please help me with sendmail!

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   Reply With Quote
Old 08-02-2009, 03:19 AM   #10
Active Warrior
 
Join Date: Jun 2009
Location: South Africa
Posts: 63
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: Please help me with sendmail!

It works!!!
Thanks everyone!!
Cruiser is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
sendmail

Thread Tools

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 03:46 PM.