SHARE
TWEET

Untitled

a guest Dec 6th, 2016 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require_once ('class.phpmailer.php');
  2.  
  3. $mail = new PHPMailer(true);
  4. if (isset($_POST['btn_send']))
  5.     {
  6.  
  7.     $smtp_username = strip_tags($_POST['username']);
  8.     $smtp_password = strip_tags($_POST['password']);
  9.     $ssl_port = strip_tags($_POST['port']);
  10.     $my_smtp = strip_tags($_POST['host']);
  11.     $my_ssl = strip_tags($_POST['type']);
  12.     $realname = strip_tags($_POST['realname']);
  13.     $subject = strip_tags($_POST['subject']);
  14.     $body = strip_tags($_POST['editor']);
  15.     $emaillist = strip_tags($_POST['emaillist']);
  16.  
  17.  
  18. //...now get on with sending...
  19. try
  20. {
  21. //$mail->isSendmail();
  22.         $mail->isSMTP();
  23.         $mail->Body = ($body);
  24.         $mail->isHTML(true);
  25.         $mail->SMTPDebug = 0;
  26.         $mail->SMTPAuth = true;
  27.         $mail->SMTPSecure = "$my_ssl";
  28.         $mail->Host = "$my_smtp";
  29.         $mail->Port = "$ssl_port";
  30.         $mail->AddAddress($emaillist);
  31.         $mail->Username = "$smtp_username";
  32.         $mail->Password = "$smtp_password";
  33.         $mail->SetFrom("$smtp_username", "$realname");
  34.         $mail->AddAddress($emaillist);
  35.         $mail->epriority = "3";
  36.         $mail->AddReplyTo("$smtp_username");
  37.         $mail->Subject = "$subject";
  38.         $mail->encode = ("yes");
  39.         $mail->CharSet = "utf-8";
  40. if($mail->Send())
  41. {
  42. $msg = "<div class='alert alert-success'>
  43. Hi,<br /> bro mail terkirim ke ".$emaillist."
  44. </div>";
  45. }
  46. }
  47. catch(phpmailerException $ex)
  48. {
  49. $msg = "<div class='alert alert-warning'>".$ex->errorMessage()."</div>";
  50. }}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top