Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Wednesday, July 28th at 3pm PST / 6pm EST. Learn more
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New to this whole PHPMailer thing... There do I start with this?

I have a bootstrap with a contact_form.php file for a prebuilt contact form, the file reads like this:



require 'phpmailer/phpmailer/PHPMailerAutoload.php';

$mail = new PHPMailer;
$mail->SMTPDebug = 4;
// Setting up PHPMailer
// Set mailer to use SMTP
// Visit for more info on server settings
// For GMail    =>
//     Hotmail  =>
//     Yahoo    =>
//     Lycos    =>
//     AOL      =>
$mail->Host = '';                       // Specify main and backup server
$mail->SMTPAuth = true;                               // Enable SMTP authentication
//This is the email that you need to set so PHPMailer will send the email from 
$mail->Username = 'USERNAME';             // SMTP username
$mail->Password = 'PASSWORD';                           // SMTP password
$mail->SMTPSecure = 'tls';
$mail->Port = 587;                                    // TCP port to connect to
// Add the address to send the mail to
$mail->WordWrap = 50;                                 // Set word wrap to 50 characters
$mail->IsHTML(true);                                  // Set email format to HTML

// add your company name here
$company_name = 'COMPANY';

// choose which fields you would like to be validated separated by |
// options required - check input has content valid_email - check for valid email
$field_rules = array(
    'name' => 'required',
    'email'   => 'required|valid_email',
    'message' => 'required'

// change your error messages here
$error_messages = array(
    'required'    => 'This field is required',
    'valid_email' => 'Please enter a valid email address'

My questions are as follows:


I want the emails to go to my regular browser gmail account, what do I need to do to set this up? What user name and password am I putting in? What server / port am I using? no clue where to start with this. Any help is appreciated.