Contact form and google maps not working

17 replies · opened Jun 6, 2017

Bbella_3333Jun 6, 2017

Hi,

For some reason the files are reading please view website.
Both contact form and google map doesn't seem to be working.

SSemicolon WebSTAFFJun 8, 2017

Hello,

We have just checked out your Website and the Google Maps appears to be working fine for us.

The Contact Form is not working because the include/sendemail.php File is returning a 500 Internal Server Error from your Servers. Please make sure that the File is properly uploaded to your Servers. Additionally, also make sure that PHPMailer is allowed on your Servers from your Web Hosting Provider.

This will definitely fix your issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Bbella_3333Jun 8, 2017

Hi, the files are loaded on the server. Where exactly do they need to placed so I can verify they are correct place?

Bbella_3333Jun 8, 2017

So I even spoke to the hosting - This is what they said.
"May i recommend that you use the following attached ones which will serve as authorities when sending. I noticed that within your script you have a port set as 26. Would you mind trying 25 or 587 which is also included in the attachments"

There were 3 files given. Not sure where to add the code of the index.php file and if thats the issue.
**index.php **
<?php
include('SMTPconfig.php');
include('SMTPClass.php');
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['sub'];
$body = $_POST['message'];
$SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body);
$SMTPChat = $SMTPMail->SendMail();
}
?>
<form method="post" action="">
To:<input type="text" name="to" />
From :<input type='text' name="from" />
Subject :<input type='text' name="sub" />
Message :<textarea name="message"></textarea>
<input type="submit" value=" Send " />
</form>

SMTPCLass
<?php
class SMTPClient
{

function SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body)
{

$this->SmtpServer = $SmtpServer;
$this->SmtpUser = base64_encode ($SmtpUser);
$this->SmtpPass = base64_encode ($SmtpPass);
$this->from = $from;
$this->to = $to;
$this->subject = $subject;
$this->body = $body;

if ($SmtpPort == "")
{
$this->PortSMTP = 25;
}
else
{
$this->PortSMTP = $SmtpPort;
}
}

function SendMail ()
{
if ($SMTPIN = fsockopen ($this->SmtpServer, $this->PortSMTP))
{
fputs ($SMTPIN, "EHLO ".$HTTP_HOST."\r\n");
$talk["hello"] = fgets ( $SMTPIN, 1024 );
fputs($SMTPIN, "auth login\r\n");
$talk["res"]=fgets($SMTPIN,1024);
fputs($SMTPIN, $this->SmtpUser."\r\n");
$talk["user"]=fgets($SMTPIN,1024);
fputs($SMTPIN, $this->SmtpPass."\r\n");
$talk["pass"]=fgets($SMTPIN,256);
fputs ($SMTPIN, "MAIL FROM: <".$this->from.">\r\n");
$talk["From"] = fgets ( $SMTPIN, 1024 );
fputs ($SMTPIN, "RCPT TO: <".$this->to.">\r\n");
$talk["To"] = fgets ($SMTPIN, 1024);
fputs($SMTPIN, "DATA\r\n");
$talk["data"]=fgets( $SMTPIN,1024 );
fputs($SMTPIN, "To: <".$this->to.">\r\nFrom: <".$this->from.">\r\nSubject:".$this->subject."\r\n\r\n\r\n".$this->body."\r\n.\r\n");
$talk["send"]=fgets($SMTPIN,256);
//CLOSE CONNECTION AND EXIT ...
fputs ($SMTPIN, "QUIT\r\n");
fclose($SMTPIN);
//
}
return $talk;
}
}
?>

SMTPconfig file
<?php
//Server Address
$SmtpServer="127.0.0.1";
$SmtpPort="25"; //default
$SmtpUser="username";
$SmtpPass="password";
?>

Bbella_3333Jun 9, 2017

So I've spoken to the host again and they said php mailer is enabled. I did another test with a contact form and the same thing happens. Not sure what the issue is?

SSemicolon WebSTAFFJun 12, 2017

Hello,

We have checked out your include/sendemail.php File again and there definitely appears to be an issue with the Hosting Environment since it returns a 500 Internal Server Error: http://www.newgx.designelite.co.za/include/sendemail.php .

Additionally, can you please send us your include/sendemail.php File so that we can cross-check for any issues. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Bbella_3333Jun 12, 2017

Attached script.

Bbella_3333Jun 12, 2017

Hi

So I finally got the email to send, I changed permissions on some of the files. But the issue now is that although it gets sent on the webpage it does not say it was sent and just sits there. Anyidea?

Bbella_3333Jun 12, 2017

so another thing was I had to add the detail here for the form to get sent through. Although it still stalls on the website and loads and loads.

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.designelite.co.za";
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->Port = 25;
$mail->Username = "info@url.co.za";
$mail->Password = "mypassword;

Bbella_3333Jun 12, 2017

I've also tried updating the port from 26.25 and 587 still nothing.
So then I set $mail->SMTPDebug = false; and it works.
1)Not sure why i have to set it to false, any idea?
2)Also is there a way not to add password to get the emails?
3) The form I receive has the following. I don't need phone and service how do I delete that from the form being sent to my email. On the form itself it does not have those heading.
Name:
Email:
Phone:
Service:
Message:

Bbella_3333Jun 20, 2017

The above email was sent on June 12 and still have not received feedback?

SSemicolon WebSTAFFJun 20, 2017

Hello,

We Really Apologize about the Delays!

  1. Please set it to $mail->SMTPDebug = 0; .

  2. If you are using SMTP, you will need to Authenticate with your Username/Password in order to receive Emails. If you do not want to use Passwords, you will need to use the PHP mail() Functionality which is setup by default in the Files that come with the Package.

  3. Firstly, you will need to delete the Fields from the Form. Then you can simply find the following code in the include/sendemail.php File:

$body = "$name $email $phone $service $message $referrer";

and delete the $phone $service Code from the above. This will disable the Phone and Service Field from the Form.

Hope this Helps! Thanks for your Patience!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFJul 23, 2017

Hello,

Please find the following code in the include/sendemail.php File:

$mail->Port = 26;

and then consider replacing it with:

$mail->Port = 465;
$mail->SMTPSecure = "ssl"

This should fix the issue. Additionally, it is also recommended to contact your Web Hosting Provider and get your Server's SMTP Settings.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFJul 26, 2017

Hello,

Since this is a Server Issue, please contact your Web Hosting Provider regarding this and request them Full SMTP Configuration details so that the PHPMailer Codes can be modified according to that to make it workable. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard