External SMTP server
Posted: Thu Aug 23, 2007 2:41 pm
Hey everyone,
I cannot seem to connect to my external SMTP server. Here is the code I'm using:
I cannot seem to connect to my external SMTP server. Here is the code I'm using:
Code: Select all
require_once "../Swift/lib/Swift.php";
require_once "../Swift/lib/Swift/Connection/SMTP.php";
require_once "../Swift/lib/Swift/Authenticator/LOGIN.php";
$conn =& new Swift_Connection_SMTP("mail.midstatemutual.com");
$conn->attachAuthenticator(new Swift_Authenticator_LOGIN());
$swift =& new Swift($conn);
$smtp->setUsername("user_hidden");
$smtp->setpassword("pass_hidden");
$swift =& new Swift($smtp);
if ($swift->send($message, "gregj@midstatemutual.com", "admin@midstatemutual.com")) echo "Sent";
else echo "Failed";