Example #1
0
 * Setup mail server config
 */
//where we would like to send email
$recipientEmail = '*****@*****.**';
$recipientName = 'Recipient Name';
//Address which will be visible in "From" field
$fromEmail = '*****@*****.**';
$fromName = 'Site Admnistrator';
//Validation error messages
$requiredMessage = 'Field is required';
$invalidEmail = 'Invalid email';
/**
 * Advanced configuration - no need to modify
 */
require_once dirname(__FILE__) . '/vendor/ctPHPMailer.php';
$mail = new ctPHPMailer();
//set your email address
$mail->AddAddress($recipientEmail, $recipientName);
$mail->SetFrom($fromEmail, $fromName);
$debug = false;
//if problems occur, set to true to view debug messages
/**
 * For GMAIL configuration please use this values:
 *
 * $mail->Host = "smtp.gmail.com"; // SMTP server
 * $mail->Username = "******"; // SMTP account username
 * $mail->Password = "******"; // SMTP account password
 * $mail->Port = 465; // set the SMTP port for the GMAIL server
 * $mail->SMTPSecure = "ssl";
 *
 * More configuration options available here: https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/ExamplesPage
Example #2
0
<?php

$ajax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
//we do not allow direct script access
if (!$ajax) {
    //redirect to contact form
    $form = '../invia-contact.html';
    header("Location: " . $form);
    exit;
}
require_once dirname(__FILE__) . '/vendor/ctPHPMailer.php';
$debug = false;
//if problems occur, set to true to view debug messages
$mail = new ctPHPMailer();
/**
For GMAIL configuration please use this values:

$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->Username = "******"; // SMTP account username
$mail->Password = "******"; // SMTP account password
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->SMTPSecure = "ssl";

More configuration options available here: https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/ExamplesPage
*/
/**
 * SERVER CONFIG
 */
$mail->Host = "mail.yourdomain.com.";
// sets the SMTP server
$mail->Username = "******";
Example #3
0
<?php

/**
 * Setup mail server config
 */
require_once dirname(__FILE__) . '/vendor/ctPHPMailer.php';
$debug = false;
//if problems occur, set to true to view debug messages
$mail = new ctPHPMailer();
/**
For GMAIL configuration please use this values:

$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->Username = "******"; // SMTP account username
$mail->Password = "******"; // SMTP account password
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->SMTPSecure = "ssl";

More configuration options available here: https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/ExamplesPage
*/
/**
 * SERVER CONFIG
 */
/**
 * Config for SMTP
 */
$mail->Host = "mail.yourdomain.com.";
// sets the SMTP server
$mail->Username = "******";
// SMTP account username
$mail->Password = "******";