Advertisement
phamthanhnhan14

mailphp

Oct 5th, 2018
1,159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2.     include('class.smtp.php');
  3.     include "class.phpmailer.php";
  4.     $nFrom = "Test";    
  5.     $mFrom = 'nhien@mail.1and0nly.jp';
  6.     $mUser = 'nhien@mail.1and0nly.jp';  
  7.     $mPass = 'yourpass';
  8.     $nTo = 'sample@gmail.com';
  9.     $mTo = 'sample@gmail.com';
  10.     $mail             = new PHPMailer();
  11.     $body             = 'Test';
  12.     $title = 'Mail';
  13.     $mail->IsSMTP();            
  14.     $mail->CharSet  = "utf-8";
  15.     $mail->SMTPDebug  = 1;
  16.     $mail->SMTPAuth   = true;
  17.     #$mail->SMTPSecure = "tls";
  18.    $mail->Host       = "mail.1and0nly.jp";
  19.     $mail->Port       = 25;
  20.     $mail->Username   = $mUser;
  21.     $mail->Password   = $mPass;
  22.     $mail->SetFrom($mFrom, $nFrom);
  23.     #$mail->AddReplyTo('info@freetuts.net', 'Freetuts.net');
  24.    $mail->Subject    = $title;
  25.     $mail->MsgHTML($body);
  26.     $mail->AddAddress($mTo, $nTo);
  27.     if(!$mail->Send()) {
  28.         echo 'ERROR!';
  29.     } else {
  30.         echo 'SUCCESSFUL!. ';
  31.     }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement