I am having trouble getting SMTP to work with Gmail in PHPScheduleIt.
Here are what I believe to be the related areas of code:
Smtp.class.php
/**
* SMTP server port
* @var int
*/
var $SMTP_PORT = 465;
var $SMTP_HOST = 'smtp.gmail.com';
PHPMailer.class.php
/**
* Method to send mail: ("mail", "sendmail", or "smtp").
* @var string
*/
var $Mailer = "smtp";
and...
/**
* Sets the SMTP hosts. All hosts must be separated by a
* semicolon. You can also specify a different port
* for each host by using this format: [hostname:port]
* (e.g. "smtp1.example.com:25;smtp2.example.com").
* Hosts will be tried in order.
* @var string
*/
var $Host = "smtp.gmail.com";
/**
* Sets the default SMTP server port.
* @var int
*/
var $Port = 465;
/**
* Sets the SMTP HELO of the message (Default is $Hostname).
* @var string
*/
var $Helo = "";
/**
* Sets SMTP authentication. Utilizes the Username and Password variables.
* @var bool
*/
var $SMTPAuth = "true";
/**
* Sets SMTP username.
* @var string
*/
var $Username = "user@gmailaddress";
/**
* Sets SMTP password.
* @var string
*/
var $Password = "********";
/**
* Sets the SMTP server timeout in seconds. This function will not
* work with the win32 version.
* @var int
*/
var $Timeout = 10;
/**
* Sets SMTP class debugging on or off.
* @var bool
*/
var $SMTPDebug = true;
/**
* Prevents the SMTP connection from being closed after each mail
* sending. If this is set to true then to close the connection
* requires an explicit call to SmtpClose().
* @var bool
*/
var $SMTPKeepAlive = false;
config\config.php
// How to send email ['mail']
/* Options are:
'mail' for PHP default mail
'smtp' for SMTP
'sendmail' for sendmail
'qmail' for qmail MTA
*/
$conf['app']['emailType'] = 'smtp';
// SMTP email host address []
// This is only required if emailType is SMTP
$conf['app']['smtpHost'] = 'smtp.gmail.com';
// SMTP port [25]
// This is only required if emailType is SMTP
$conf['app']['smtpPort'] = 465;
php.ini
[mail function]
; For Win32 only.
SMTP = "smtp.gmail.com"
smtp_port = 465
; For Win32 only.
sendmail_from = "noreply@kgcs.k12.va.us"
Here are the errors:
Fatal error: mail() [function.mail]: Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Program Files\wamp\www\kgcsres\lib\Reservation.class.php on line 743
Fatal error: Maximum execution time of 60 seconds exceeded in D:\Program Files\wamp\www\kgcsres\lib\Reservation.class.php on line 744
(First two happen when creating a reservation)
Fatal error: Maximum execution time of 60 seconds exceeded in D:\Program Files\wamp\www\kgcsres\lib\Smtp.class.php on line 1018
(This one happens when deleting a reservation)
I tried adding ssl:// in front of smtp.gmail.com, but got and fsockopen error related to the length. Has anyone successfully set up SMTP with Gmail and PHPScheduleIt? Any ideas on what I am doing wrong? Thanks in advance.