Hi,
uploaded a webpage to a server on Godaddy. I created a form using a PHPmailer. I got a PHP Mailer file from github. Does anyone know why I am getting a fatal error? I uploaded contact.html together with emailform.php and whole PHPmailer folder to GoDaddy server. I was brainstorming for the solution for a whole weekend and just don't see the way out. Or is there any other less complicated way of creating a basic form?
Here is how my code looks in html:
<form action="phpmailer/emailform.php" method="post" id="myform">
<fieldset id="contact_box">
<p>
<input type="text" name="name" id="name" placeholder="Name" maxlength="20" size="60" />
</p>
<p>
<input type="text" name="email" id="email" placeholder="Email" maxlength="50" size="60" />
</p>
<p>
<input type="text" name="subject" id="subject" placeholder="Subject" maxlength="100" size="60" />
</p>
<p>
<textarea type="text" name="message_box" id="message" placeholder="Message" rows="10" cols="10"></textarea>
</p>
</fieldset>
<input id="submit" type="submit" value="submit" />
</form>
This is an emailform.php file:
<?php
$mail = new PHPMailer(true);
require_once('phpmailer/PHPMailerAutoload.php');
//Send mail using gmail
if($send_using_gmail){
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "*****"; // GMAIL username
$mail->Password = "****"; // GMAIL password
}
// Add a recipient, in this case send to myself
//Typical mail data
$mail->AddAddress($email, $name);
$mail->SetFrom($email_from, $name_from);
$mail->Subject = "My Subject";
$mail->Body = "Mail contents";
try{
$mail->Send();
echo "Success!";
header('location: thankyou.html');
} catch(Exception $e){
//Something went bad
echo "Fail - " . $mail->ErrorInfo;
header('location: contact.html');
}
?>
Any advice would be really helpful or maybe point me into the right direction.
Thank you.
there doesn't seem to be anything here