Bagaimana cara mengimplemnetasikan konfigurasi smtp standart ke dalam script yang saya gunakan tersebut. ke dalam OJS

bagaimana cara mengimplemnetasikan konfigurasi smtp standart ke dalam script yang saya gunakan tersebut. ke dalam OJS

<?php require_once('PHPMailer/class.phpmailer.php'); $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->IsSMTP(); // telling the class to use SMTP try { $mail->Host = ""; // SMTP server $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "tls"; $mail->Port = 587; // set the SMTP port for the GMAIL server $mail->Username = ""; // GMAIL username $mail->Password = "..............."; // GMAIL password $mail->AddAddress(''); $mail->SetFrom('', 'Graha | Layanan'); $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail->MsgHTML(file_get_contents('PHPMailer/examples/contents.html')); $mail->Send(); echo "Message Sent OK, to :"; } catch (phpmailerException $e) { echo $e->errorMessage(); //Pretty error messages from PHPMailer } catch (Exception $e) { echo $e->getMessage(); //Boring error messages from anything else!

OJS already implements standard SMTP connections. See the configuration in

In OJS 2.4.x, this only allows plaintext email. In OJS 3.x, the PHPMailer library is used to allow HTML messages as well.

saya sudah menggunakan contoh skrip di atas, tetapi masih menemui masalah pada error_log muncul :
[05-Apr-2017 02:46:16 UTC] OJS SMTPMailer: Did not receive expected 250 or 251

bagaimana cara

; Email Settings ;


; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = “
smtp_port = 587

; Enable SMTP authentication
;Supported mechanisms: ssl, tls
smtp_auth = tls
smtp_username = “
smtp_password = “…123”

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
default_envelope_sender =

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide noreply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = Off

; Enable attachments in the various “Send Email” pages.
; (Disabling here will not disable attachments on features that
; require them, e.g. attachment-based reviews)
enable_attachments = On

; Amount of time required between attempts to send non-editorial emails
; in seconds. This can be used to help prevent email relaying via OJS.
time_between_emails = 3600

; Maximum number of recipients that can be included in a single email
; (either as To:, Cc:, or Bcc: addresses) for a non-priveleged user
max_recipients = 10

; If enabled, email addresses must be validated before login is possible.
require_validation = Off

; Maximum number of days before an unvalidated account expires and is deleted
validation_timeout = 14

Do you get a similar error message when running the sample PHP code from your first posting?

Or does the PHP code you posted work, but the error message only occurs in OJS?