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';
    }
}
Beispiel #2
0
 public function sendmail($from, $to, $subject, $body, $altbody = null, $options = null, $attachments = null, $html = false)
 {
     if (!is_array($from)) {
         $from = array($from, $from);
     }
     $mail = new phpmailer();
     $mail->PluginDir = 'M/lib/phpmailer/';
     if ($this->getConfig('smtp')) {
         $mail->isSMTP();
         $mail->Host = $this->getConfig('smtphost');
         if ($this->getConfig('smtpusername')) {
             $mail->SMTPAuth = true;
             $mail->Port = $this->getConfig('smtpport') ? $this->getConfig('smtpport') : 25;
             $mail->SMTPDebug = $this->smtpdebug;
             $mail->Username = $this->getConfig('smtpusername');
             $mail->Password = $this->getConfig('smtppassword');
         }
     }
     $mail->CharSet = $this->getConfig('encoding');
     $mail->AddAddress($to);
     $mail->Subject = $subject;
     $mail->Body = $note . $body;
     $mail->AltBody = $altbody;
     if (!is_array($from)) {
         $from = array($from, $from);
     }
     $mail->From = $from[0];
     $mail->FromName = $from[1];
     if (key_exists('reply-to', $options)) {
         $mail->AddReplyTo($options['reply-to']);
         unset($options['reply-to']);
     }
     if (key_exists('Sender', $options)) {
         $mail->Sender = $options['Sender'];
     }
     if (null != $attachments) {
         if (!is_array($attachments)) {
             $attachments = array($attachments);
         }
         foreach ($attachments as $k => $v) {
             if (!$mail->AddAttachment($v, basename($v))) {
                 trigger_error("Attachment {$v} could not be added");
             }
         }
     }
     $mail->IsHTML($html);
     $result = $mail->send();
 }
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';
     }
 }
                echo APP_URL;
                ?>
/restore/?hash=<?php 
                echo $restorePointInfo['hash'];
                ?>
</a> to reset your password.
                        </body>
                    </html>

                <?php 
                $from = SMTP_EMAIL;
                $to = $email;
                $html_text = ob_get_clean();
                $subject = APP_TITLE . " | Password reset";
                $mail = new phpmailer();
                $mail->isSMTP();
                // Set mailer to use SMTP
                $mail->Host = SMTP_HOST;
                // Specify main and backup SMTP servers
                $mail->SMTPAuth = SMTP_AUTH;
                // Enable SMTP authentication
                $mail->Username = SMTP_USERNAME;
                // SMTP username
                $mail->Password = SMTP_PASSWORD;
                // SMTP password
                $mail->SMTPSecure = SMTP_SECURE;
                // Enable TLS encryption, `ssl` also accepted
                $mail->Port = SMTP_PORT;
                // TCP port to connect to
                $mail->From = $from;
                $mail->FromName = APP_TITLE;
Beispiel #5
0
if (!$up) {
    header("location: reply_mail.php?msg=nup&id=?id");
    die;
}
/*
get id for user 
*/
require 'connection.php';
$query = $conn->prepare("SELECT email FROM messages WHERE id=?");
$query->bindValue(1, $id, PDO::PARAM_INT);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
extract($result);
require_once 'phpmailer/PHPMailerAutoload.php';
$m = new phpmailer();
$m->isSMTP();
$m->SMTPAuth = true;
$m->Host = 'smtpout.secureserver.net';
$m->username = '******';
$m->password = '******';
$m->SMTPSecure = 'ssl';
$m->Port = '465';
$m->From = '*****@*****.**';
$m->FromName = 'pixllart.com';
$m->addReplyTo('', '');
$m->addAddress($email, '');
$m->isHtml(true);
$m->subject = 'frist message';
$m->Body = '<p>$msg</p><br><br> <img src="image/' . $img_name . '">';
$m->AltBody = '';
if ($m->send()) {