function send_mail($email, $date, $time)
{
    require '../phpmailer/PHPMailerAutoload.php';
    $mail = new phpmailer();
    $mail->isSMTP();
    $mail->Host = 'smtp.gmail.com';
    $mail->SMTPAuth = true;
    $mail->Username = '******';
    $mail->Password = '******';
    $mail->SMTPSecure = 'tls';
    $mail->Port = 587;
    $mail->setFrom('*****@*****.**', 'Mailer');
    $mail->addAddress('' . $email . '', 'user');
    $mail->isHTML(true);
    $mail->Subject = 'booking';
    $mail->Body = 'This email is coming from global styling to: ' . $email . ' </br>
								your booking is set for ' . $date . ' at ' . $time . ' 
								thank you for booking with us. Global Styling';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    if (!$mail->send()) {
        echo 'Message could not be sent.';
        echo 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        echo 'Message has been sent to your E-Mail address';
    }
}
    $mail = new phpmailer();
    if (!isset($error_message) && !$mail->ValidateAddress($email)) {
        $error_message = "Invalid Email Address";
    }
    if (!isset($error_message)) {
        $email_body = "";
        $email_body .= "Name: " . $name . "\n";
        $email_body .= "Email: " . $email . "\n";
        $email_body .= "Suggested Item\n";
        $email_body .= "Category: " . $category . "\n";
        $email_body .= "Title: " . $title . "\n";
        $email_body .= "Format: " . $format . "\n";
        $email_body .= "Genre: " . $genre . "\n";
        $email_body .= "Year: " . $year . "\n";
        $email_body .= "Details: " . $details . "\n";
        $mail->setFrom($email, $name);
        $mail->addAddress('*****@*****.**', 'Daisho');
        // Add a recipient
        $mail->isHTML(false);
        // Set email format to HTML
        $mail->Subject = 'Personal Media Library Suggestion from ' . $name;
        $mail->Body = $email_body;
        if ($mail->send()) {
            header("location:suggest.php?status=thanks");
            exit;
        }
        $error_message = 'Message could not be sent.';
        $error_message .= 'Mailer Error: ' . $mail->ErrorInfo;
    }
}
$pageTitle = "Suggest a Media Item";
Beispiel #3
0
 function send_mail()
 {
     require 'phpmailer/PHPMailerAutoload.php';
     $email = "";
     $mail = new phpmailer();
     $mail->isSMTP();
     $mail->Host = 'smtp.gmail.com';
     $mail->SMTPAuth = true;
     $mail->Username = '******';
     $mail->Password = '******';
     $mail->SMTPSecure = 'tls';
     $mail->Port = 587;
     $mail->setFrom('*****@*****.**', 'Mailer');
     $mail->addAddress('*****@*****.**', 'user');
     $mail->isHTML(true);
     $mail->Subject = 'The code works';
     $mail->Body = 'This email is coming from <b> GLOBAL STYLING SALONS !! </b>';
     $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
     if (!$mail->send()) {
         echo 'Message could not be sent.';
         echo 'Mailer Error: ' . $mail->ErrorInfo;
     } else {
         echo 'Message has been sent to your E-Mail address';
     }
 }