Possible causes for swiftmailer not working?
Posted: Tue Oct 17, 2006 6:13 pm
Here's the E-Mail propblem I'm having. Swiftmailer doesn't send messages on the web host I'm using (it doesn't report any errors, though) although the exact same code works fine on a machine I'm using for development (Fedora core 5, running with dynamic DNS)
Here's the code in question (well the appropriate sections)
And the main section:
Does anyone know why this might work on one machine but not another?
Here's the code in question (well the appropriate sections)
Code: Select all
<?php
require('Swift-2.1.16/Swift.php');
require('Swift-2.1.16/Swift/Connection/Sendmail.php');
require('Swift-2.1.16/Swift/Connection/SMTP.php');
$connection = new Swift_Connection_Sendmail(SWIFT_AUTO_DETECT);
//$connection = new Swift_Connection_SMTP('mail.danielsnowden.co.uk');
$mailer = new Swift($connection);
?>Code: Select all
$subject = "User Password For $user_name_reset";
$message = "This is an automated message. If you did not intend to recieve it, please ignore it.\n\nYou requested your password to be reset and/or confirmation of your username.\n\nUsername: $user_name_reset\nPassword: $pass\n\nRegards, Dan";
if ($mailer->isConnected())
{
//Sends a simple email
$mailer->send(
$email_reset,
"$admin_email@$server_addr",
$subject,
$message
);
}
else {
print "<p>Warning, message delivery failure!</p>\n";
}