Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (68414 Members, 793 Products, 5353 Topic, 13045 Comments)

cara seting aplikasi E-PAPER

Dibuat
Login Terakhir 2 Bulan lalu,
Telah Dilihat 1167 Kali
Dadan Nurhaman D Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2. Cara Seting PhpMailler

Ada 1 Jawaban

Bukhori Muslim
commented on 09 Mei 2020 07:27:10
  1. Assalamualaikum,.. disini sudah djelaskan gan + source code :
  2. https://github.com/PHPMailer/PHPMailer
  3.  
  4. <?php
  5. // Import PHPMailer classes into the global namespace
  6. // These must be at the top of your script, not inside a function
  7. use PHPMailer\PHPMailer\PHPMailer;
  8. use PHPMailer\PHPMailer\SMTP;
  9. use PHPMailer\PHPMailer\Exception;
  10.  
  11. // Load Composer's autoloader
  12. require 'vendor/autoload.php';
  13.  
  14. // Instantiation and passing `true` enables exceptions
  15. $mail = new PHPMailer(true);
  16.  
  17. try {
  18. //Server settings
  19. $mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
  20. $mail->isSMTP(); // Send using SMTP
  21. $mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through
  22. $mail->SMTPAuth = true; // Enable SMTP authentication
  23. $mail->Username = 'user@example.com'; // SMTP username
  24. $mail->Password = 'secret'; // SMTP password
  25. $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
  26. $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
  27.  
  28. //Recipients
  29. $mail->setFrom('from@example.com', 'Mailer');
  30. $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
  31. $mail->addAddress('ellen@example.com'); // Name is optional
  32. $mail->addReplyTo('info@example.com', 'Information');
  33. $mail->addCC('cc@example.com');
  34. $mail->addBCC('bcc@example.com');
  35.  
  36. // Attachments
  37. $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  38. $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  39.  
  40. // Content
  41. $mail->isHTML(true); // Set email format to HTML
  42. $mail->Subject = 'Here is the subject';
  43. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  44. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  45.  
  46. $mail->send();
  47. echo 'Message has been sent';
  48. } catch (Exception $e) {
  49. echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
  50. }
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online