We have an intranet that sends out reminder emails once a day and uses a remote SMTP server since the local server doesn't handle email. I switched to Swift Mailer b/c I like it's ease of use and such, but I'm having some problems getting it to work. My test script is the following and the error I get is just after that. Can anyone tell me what is wrong? I'm sorry, but I removed some variables that are private... but you get the idea. The email addresses/passwords are all valid... no facades.
Code: Select all
require_once "inc/mail/Swift.php";
require_once "inc/mail/Swift/Connection/SMTP.php";
$smtp =& new Swift_Connection_SMTP("69.64.68.138");
$smtp->setUsername("ValidFromAddress");
$smtp->setpassword("********");
$swift =& new Swift($smtp);
$message =& new Swift_Message("Some subject", "Your message <u>here</u>", "text/html");
if ($swift->send($message, "ValidToAddress", "ValidFromAddress"))
{
echo "Message sent";
}
else
{
echo "Message failed to send";
}
//It's polite to do this when you're finished
$swift->disconnect();Code: Select all
Fatal error: Uncaught exception 'Swift_ConnectionException' with message 'The SMTP connection did not allow the command 'EHLO [192.168.1.110]' to be sent. (fsockopen: #0) ' in C:\xampplite\htdocs\inc\mail\Swift\Connection\SMTP.php:270 Stack trace: #0 C:\xampplite\htdocs\inc\mail\Swift.php(299): Swift_Connection_SMTP->write('EHLO [192.168.1...', '??') #1 C:\xampplite\htdocs\inc\mail\Swift.php(261): Swift->command('EHLO [192.168.1...', 250) #2 C:\xampplite\htdocs\inc\mail\Swift.php(220): Swift->handshake(Object(Swift_Events_ResponseEvent)) #3 C:\xampplite\htdocs\inc\mail\Swift.php(101): Swift->connect() #4 C:\xampplite\htdocs\test.php(11): Swift->__construct(Object(Swift_Connection_SMTP)) #5 {main} thrown in C:\xampplite\htdocs\inc\mail\Swift\Connection\SMTP.php on line 270