jonmbake / bootstrap3-contact-form

Bootstrap 3 Contact Form with Captcha
MIT License
169 stars 84 forks source link

ELI5 Configuration? #22

Closed renyygade closed 8 years ago

renyygade commented 8 years ago

I apologize if I should've known this already, but I haven't really ventured much outside of HTML and CSS.

In an attempt to set up this for someone I made an easy website for a while ago, I can't figure out what to configure sendmail.php. I am not using Environment Variables.

//attempt to send email
  $messageBody = constructMessageBody();
  require './vender/php_mailer/PHPMailerAutoload.php';
  $mail = new PHPMailer;
  $mail->CharSet = 'UTF-8';
  $mail->isSMTP();
  $mail->Host = "smtp.gmail.com";
  $mail->SMTPAuth = true;
  $mail->Username = "me@gmail.com";
  $mail->Password = "my!password";

  $mail->SMTPSecure = 'tls';
  $mail->Port = 587;

  $mail->setFrom($_POST['email'], $_POST['name']);
  $mail->addAddress("me@gmail.com");
  $mail->Subject = $_POST['reason'];
  $mail->Body  = $messageBody;

What exactly do I put into "Host", "Username", "Password" and "addAddress"? This is out of my comfort zone to say the least.

jonmbake commented 8 years ago

The contact form needs to use an email account to send the email. If you have ever set up an email account on Mail for Mac, or Outlook etc. on Windows, it is the same kind of deal.

jonmbake commented 8 years ago

The addAddress defines the email address the message will be sent to. Almost always it should be sent to the same account as the one used to send it.