Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail->ClearAllRecipients();
- $mail->setFrom('mail@domain.com', 'Mailer');
- $mail->addAddress('mail@info.com', 'Joe User');
- $mail->addAddress('mail@info.com');
- $mail->addReplyTo('info@example.com', 'Information');
- [P54] => Array
- (
- [0] => Array
- (
- [id] => 54
- [type] => Package
- [values] => Array
- (
- [0] => Array
- (
- [name] => Farmaan Mansoori
- [email] => info@demo.com
- [phone] => 425698745
- [date_book] => 2018-09-20
- [adults] => 1
- [child] => 0
- [infant] => 0
- [room] => 0
- [suppliment] => no
- [hotel] => 3 Star
- [img] => London Paris.jpg
- [price] => Array
- (
- [0] => 3540
- [1] => 3100
- [2] => 2635
- [3] => 1
- [4] => 440
- )
- [package_name] => london_paris
- [id] => 54
- [type] => Package
- )
- )
- )
- )
- use PHPMailerPHPMailerPHPMailer;
- use PHPMailerPHPMailerException;
- require 'vendor/autoload.php';
- $mail = new PHPMailer(true);
- try {
- $mail->SMTPDebug = 0;
- $mail->isSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'demo@gmail.com';
- $mail->Password = 'secret';
- $mail->SMTPSecure = 'tls';
- $mail->Port = 587;
- //Recipients
- $mail->ClearAllRecipients();
- $mail->setFrom('dmeo@gmail.com', 'Mailer');
- $mail->addAddress('info@techyogiitsolutions.com', 'Joe User');
- $mail->addAddress('demo@gmail.com');
- $mail->addReplyTo('demo@example.com', 'Information');
- $mail->isHTML(true);
- $mail->Subject = "$pname Tour Booking Details";
- $mail->Body = "Hey! $name <br> You just booked a $pname . Here are some order details. <br>Adults: $adults <br> Child: $child <br> Infant: $infant <br> Hotel Type: $hotel <br> Single Rooms: $single <br> Total: $total.";
- $total = number_format($total);
- $mail->AltBody = "Hey! $name You just booked a $pname . Here are some order details.Adults: $adults Child: $child Infant: $infant Hotel Type: $hotel Single Rooms: $single Total: € $total.";
- $mail->send();
- $mail->ClearAddresses();
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
- $mail->ClearAllRecipients();
Add Comment
Please, Sign In to add comment