Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP Parse error: syntax error, unexpected 'new' (T_NEW) in C:xampphtdocsATOZqdmail.php on line 661
- use PHPMailerPHPMailerPHPMailer;
- use PHPMailerPHPMailerException;
- require 'Exception.php';
- require 'PHPMailer.php';
- require 'SMTP.php';
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
- $mail->IsSMTP();
- $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
- $mail->SMTPAuth = true;
- //$mail->CharSet = 'utf-8';
- //$mail->SMTPSecure = 'tls';
- $mail->Host = "smtp.hoge.jp";
- $mail->Port = 587;
- $mail->IsHTML(false);
- $mail->Username = 'a@hoge.com';
- $mail->Password = 'hogehoge';
- $mail->SetFrom('a@hoge.com');
- $mail->From = 'a@hoge.com';
- $mail->Subject = 'test send';
- $mail->Body = 'test send';
- $mail->AddAddress('piyo@hoge.com');
- $mail->send();
- } catch (Exception $e) {
- echo $mail->ErrorInfo;
- }
Add Comment
Please, Sign In to add comment