php - PHPMailer Failed to connect to server - Settings are correct -
i testing smtp on server, using phpmailer. smtp server works fine, on vbulletin forums, on own website engine (from localhost, port 80 open, doing via ip) following errors:
2014-04-14 12:14:18 smtp error: failed connect server: smtp connect() failed. i asked mate, whom manager of server, says there no connections coming ip.
my phpmailer settings:
public function create() { $mailer = new phpmailer(); $mailer->issmtp(); $mailer->charset = "utf-8"; $mailer->smtpsecure = "tls"; $mailer->host = config::$smtp_host; $mailer->smtpdebug = 2; $mailer->smtpauth = true; $mailer->port = config::$smtp_port; $mailer->username = config::$smtp_user; $mailer->password = config::$smtp_pass; return $mailer; } // smtp details public static $smtp_port = 25; public static $smtp_host = "argonite.net"; public static $smtp_user = "recover@argonite.net"; public static $smtp_pass = "password"; public static $recover_email = "recover@argonite.net"; and how use it:
$mailer = (new mailfactory())->create(); $mailer->addaddress($email, $username); $mailer->setfrom(config::$recover_email, "recover"); $mailer->subject = "password recovery - not reply"; $mailer->altbody = "argonite has sent password requested."; $mailer->msghtml($this->buildmessage($username, $this->getpassword($username, $email))); if (!$mailer->send()) { $fh = fopen("logs/.mailer", 'a'); fwrite($fh, "\n[" . date("y-m-d h:i:s") . "]: " . $mailer->errorinfo . "\n"); fclose($fh); return "an error has occured while sending request. administrators have been notified."; } else { return "success"; } why failing? phpmailer settings, version or apache/php configurations?
php: 5.5.9
fixed - don't know how that's settings set:
$mailer->smtpsecure = "none"; $mailer->host = config::$smtp_host; $mailer->smtpdebug = 0; $mailer->smtpauth = false; $mailer->port = config::$smtp_port; $mailer->username = config::$smtp_user; $mailer->password = config::$smtp_pass; after adding secure = "none" , auth = false, , port 25, worked.
Comments
Post a Comment