PHP Classes

Not working from HTML form

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  Not working from HTML form  >  (Un) Subscribe thread alerts  
Subject:Not working from HTML form
Summary:Can send email from command line but not from submit button
Messages:3
Author:Gary Betz
Date:2007-10-26 05:17:30
Update:2007-10-26 23:04:50
 

  1. Not working from HTML form   Reply   Report abuse  
Picture of Gary Betz Gary Betz - 2007-10-26 05:17:30
Interesting problem.... I have a PHP program that uses email_message.php class which, whn invoked from the command line (php sendmyemail.php) works fine. When invoked from a web form submit,I get no error messages or anything but I get no email delivered as in the previous case.

Any thoughts as to why this would be happening? I even hard-coded all the input variables so that this couldn't be the problem.

Thanks.

  2. Re: Not working from HTML form   Reply   Report abuse  
Picture of William William - 2007-10-26 20:37:21 - In reply to message 1 from Gary Betz
Some more information about how you are calling the script from the html form would be helpful.

However, I think the most common problem would be permissions. Make sure that your webserver user can access the class file. A way to test would be to su to nobody (assuming unix/linux and su privileges are available) and try to execute the script from the command line.

If you could provide more information, I could try to help you a little better.

  3. Re: Not working from HTML form   Reply   Report abuse  
Picture of Gary Betz Gary Betz - 2007-10-26 23:04:50 - In reply to message 2 from William
Thanks for your reply. I actually figured it out. What was happening is that I was creating the "from" address by concatenating two "shell" variables together, which are available when you run the script from the command line and not when the script is being run under apache. I change these and everything works just fine now.