Contact module - fix for 'Please make sure the form is complete and valid' error

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
mwcannon
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jun 13, 2007 5:36 pm

Contact module - fix for 'Please make sure the form is complete and valid' error

Post by mwcannon » Mon Sep 17, 2007 10:54 pm

My ISP for some unknown reason, has changed several of the processes for handling emails sent from my sites and so broke the outgoing email on a number of them. The ones I use WordPress on I was able to fix by changing settings in the phpmailer files. This has not been as simple with Joomla.

The Contact Form gives me the infamous 'Please make sure the form is complete and valid' error unless I send a message using my email in the email block. I have gotten around this by modifying the contact.html. php file around line 670 and making the email text box hidden and inserting my email address as the value:








This lets the smtp server know it's a valid user on the domain and so I can send a message successfully. I added a writeremail text box for the user to enter their email address but can't figure out how to pass it in the appropriate places to get it into an email.  I assumed the easiest way was to concatenate it with the subject in the contact.php file here (roughly line 368):

if (count( $contact ) > 0) {
$default = $mosConfig_sitename.' '. _ENQUIRY;
$email = strval( mosGetParam( $_POST, 'email', '' ) );
$text = strval( mosGetParam( $_POST, 'text', '' ) );
$name = strval( mosGetParam( $_POST, 'name', '' ) );
$subject = strval( mosGetParam( $_POST, 'subject', $default ) );
$email_copy = strval( mosGetParam( $_POST, 'email_copy', 0 ) );

I have tried a number of ways to get the address into the $subject variable but am not phpSmartEnough© to do it. Anyone have any suggestions?

Post Reply