Topic: Contact form

Hi.
I'm on shared server and mail and this don't allow me using contact form ... trying to send an email it says:

mail() has been disabled for security reasons

I had a chat with my service provider and he suggested to get in touch with my developer to use  smtp authentication method

How can I do this ?

Can You help me with this ?

Thx

Bart

Re: Contact form

The Contact Form within Showkase requires PHP mail support on the web server. (This is noted in the Version History for v1.4.0.)
Unfortunately, the SMTP authentication method is not supported.
Showkase's 'contact.php' source file would need to be rewritten to handle a different method.

You could try the following but please note that it is untested and I cannot guarantee that it will work.

Open the 'showkase/admin/plugins/contact/master/contactcore/contact.php' file in a plain text editor and change line 21 from:

$mailer->isMail();

... to:

$mailer->isSMTP(); // Use SMTP authentication
$mailer->SMTPDebug = 2; // Enable SMTP class debug output mode (data and commands)
$mailer->SMTPAuth = true; // Use SMTP authentication
$mailer->Host = 'smtp.example.com'; // Set SMTP host
$mailer->Port = 25; // Set SMPT port
$mailer->Username = 'username'; // Set SMTP username
$mailer->Password = 'password'; // Set SMTP password

You will need to fill in your own unique SMTP details (as noted in the comments above). Please contact your web host if you are unsure what they should be.

Setting SMTPDebug might be helpful for debugging purposes (if you get any warnings or errors whilst testing) but if everything works OK, you can remove this from the code above.

Please note that the line number above refers to the current version of Showkase (v1.4.0.2).

Re: Contact form

Hi Steven.
Unfortunately this didn't help. I still have the same error:
mail() has been disabled for security reasons 

I had a chat with my hosting company and they sad it's must be an issue with the script.
So from they side it's all fine.
"If you have static pages , Then you will need to contact your developer and have to design script in order to send email using email address."
also send an link:
phpmailer.worxware.com/?pg=examplebsmtp

and here is an link to contact form - gosiakryk.co.uk/Showkase/contact/

Re: Contact form

It sounds like you may not have republished your site after making the changes to the source file.
You need to republish your site in order for the changes to be transferred from the source file to your existing contact page.
Sorry. I should have mentioned this before.
If you still have problems, try creating a new contact page after republishing.
Hopefully this will help.

Re: Contact form

Hi Steven.
Ok we are one step closer. I didn't know I had to re-publish it :)
I don't get this error any more, but after I hit send it does nothing ...
all detail that You type into boxes stay on the website and nothing happened.
I've try different browsers and internet connections.

I've also moved the whole website to root directory thinning that might be the problem

gosiakryk.co.uk/contact/

Bart

Re: Contact form

Please double-check your SMTP settings. The problem is much more likely to be related to your SMTP settings than anything like the location of your Showkase site/Contact page or your browser or internet connection.

Depending on your SMTP settings, you might need to set SMTPSecure to either 'ssl' or 'tls' by adding a line of code such as the following:

$mailer->SMTPSecure = 'ssl';

... or:

$mailer->SMTPSecure = 'tls';

You might also need to ensure that the 'From' address is a valid email address on your domain.
Try changing line 91 from:

$mailer->setFrom('mailer'.strstr($siteEmail, '@'), $userName);

... to:

$mailer->setFrom('your@email.address', $userName);

Hopefully, checking that all the required SMTP settings are being used and are correct will solve your problem.

Otherwise, I'm afraid you might not be able to use the Contact Form within Showkase on your web server.
As I mentioned earlier, the Contact Form within Showkase officially requires PHP mail support and other methods are not supported.

Re: Contact form

Hi Steven.
I've downloaded PHPmailer and checked my server ... it's seams everything is fine and it allows sending PHP emails ... so I was sure it's not the host.

I've took bits and pieces from PHPMailer and paste into contact.php  copy PHP autoload and class smtp ...

It sending emails now :) but there is still some problems with >Mailer send echo

Everything staying in the boxes and I don't get info - email send or Thank you for your email.

Can You quickly explain how $mailer->send works and where it take the $output from ?

Thx

Bart

Re: Contact form

$mailer->send(); calls the send() function on line 977 of the 'showkase/admin/plugins/contact/master/contactcore/class.phpmailer.php' file (PHPMailer). You would need to delve into the PHPMailer source code (or contact their own support) for more detailed information of exactly what the send() function does as we did not write this third-party library ourselves.

The $output variable from the 'contact.php' file is either the 'Optional Contact Form -> Success message' (if the email is sent successfully) or an appropriate error message (if the email is not sent successfully).

In the 'contact.php' file, try replacing:

    $mailer->send();
        $output = json_encode(array('type'=>'message', 'text' => $response));
        echo($output);

... with:

    $mailer->send();
} catch (phpmailerException $exc) {
    echo 'Mailer error: ' . $exc->errorMessage();

If the email is not sent successfully, then an error message generated by PHPMailer itself should be displayed on the screen.
This might give you some indication of what the problem is.

Re: Contact form

Hi.
Thank You :)
I'll try this and get back with a feedback.

Thx

Bart