Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Api\mail;
- require '../../vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
- use \PHPMailer;
- class Mail
- {
- public function send($data)
- {
- $mail = new PHPMailer;
- $mail->SMTPDebug = 2;
- $mail->Debugoutput = 'html';
- $mail->Host = 'smtp.berryproject.com';
- $mail->Port = 587;
- $mail->SMTPAuth = true;
- $mail->Username = "axel.rataj@berryproject.com";
- $mail->Password = "qwe123";
- $mail->setFrom('contact@contact.pl', 'First Last');
- $mail->addAddress('ar@berryproject.com', 'John Doe');
- $mail->Subject = 'Formularz kontaktowy';
- $mail->Body = include '../mail/mail.php';
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement