Forgive me if this is my mistake (and it most likely is), as I am new to PHP - I am a C (most variants though primarily C#) programmer.
Code: Select all
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
//Connect to Gmail (PHP4)
$smtp =& new Swift_Connection_SMTP("smtp.gmail.com", SWIFT_SMTP_PORT_SECURE, SWIFT_SMTP_ENC_TLS);
$smtp->setUsername("xxxxxxxx@ice-computer.com");
$smtp->setPassword("xxxxxx");
$swift =& new Swift($smtp);
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "xxxxx@ice-computer.com", "xxxxx@ice-computer.com")) echo "Sent";
else echo "Failed";Code: Select all
Fatal error:
Uncaught Error of type [swift_connection_exception] with message [The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 0 and Error String 'The operation completed successfully. ']
@0 swift::swift() in C:\Program Files\nusphere\phped\projects\Murray-Home\Swift\SwiftMailer.php on line 11
@1 swift::connect() in C:\Program Files\nusphere\phped\projects\Murray-Home\Swift\lib\Swift.php on line 109
in C:\Program Files\nusphere\phped\projects\Murray-Home\Swift\lib\Swift\Errors.php on line 99Code: Select all
Fatal error:
Uncaught Error of type [swift_connection_exception] with message [The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 110 and Error String 'Connection timed out']
@0 swift::swift() in /home/content/h/e/n/henley1502/html/Swift/SwiftMailer.php on line 11
@1 swift::connect() in /home/content/h/e/n/henley1502/html/Swift/lib/Swift.php on line 109
in /home/content/h/e/n/henley1502/html/Swift/lib/Swift/Errors.php on line 99My hosting account has ssl sockets open.
Any assistance would be greatly appreciated.
I will state that I am impressed with your code from an OOP standpoint.
Thanks,
Steven Henley