where to put a php file in cpanel which would serve my form in html -
i'm using hostgator cpanel , domain. created website using html , in use contact form on submit goes php file , sends me email.
it works on amazon webserver don't know put php files in hostgator cpanel. should install php config somewhere , put there?
thanks in advance.
here php code <?php require 'phpmailer/phpmailerautoload.php'; $name = $_post['inputusername']; $email_address = $_post['inputemail']; $message = $_post['inputcontent']; $mail = new phpmailer; //$mail->smtpdebug = 2; $mail->issmtp(); // set mailer use smtp $mail->host = 'smtp.gmail.com'; // specify main , backup smtp servers $mail->smtpauth = true; // enable smtp authentication $mail->username = 'krishnakumar4315@gmail.com'; // smtp username $mail->password = 'password'; // smtp password $mail->smtpsecure = 'tls'; // enable tls encryption, `ssl` accepted $mail->port = 587; // tcp port connect $mail->setfrom('something@gmail.com', 'krishna'); $mail->addaddress('something@outlook.com', 'krishna'); // name optional $mail->ishtml(true); // set email format html $mail->subject = 'message from: '.$name; $mail->body = $message ." <b>email: </b>".$email_address; $mail->altbody = 'this body in plain text non-html mail clients'; if(!$mail->send()) { echo 'message not sent.'; echo 'mailer error: ' . $mail->errorinfo; } else { header('location: http://www.krishdev.com'); } ?>
Comments
Post a Comment