Swift won't send email and won't print any errors either
Posted: Wed Oct 18, 2006 2:25 am
[SOLVED]
So today I downloaded the latest version of SwiftMailer (2.1.17) and tried to send a simple email, but it failed
I unzipped it and renamed it "Swift", then I uploaded it to the root of my server. I then created a simple PHP file with the following content and uploaded it to the root as well:
I went to this page with my browser, but I got nothing... no errors, no nothing. I checked my mail box and there was nothing new there.
I thought maybe it was a problem with the server or something so I downloaded PHPMailer and tried it too, guess what... It worked - which means that the server is fine and it must be something with Swift and how I used it.
At the beginning of this post I described step by step what I did and in which order so, if anyone can help, that would be great
Any help is welcome.
So today I downloaded the latest version of SwiftMailer (2.1.17) and tried to send a simple email, but it failed
I unzipped it and renamed it "Swift", then I uploaded it to the root of my server. I then created a simple PHP file with the following content and uploaded it to the root as well:
Code: Select all
<?php
require('Swift/Swift.php');
require('Swift/Swift/Connection/SMTP.php');
$mailer = new Swift(new Swift_Connection_SMTP('alpha.dynamized.com'));
//If anything goes wrong you can see what happened in the logs
if($mailer->isConnected()) //Optional
{
//Sends a simple email
$mailer->send('"Oren" <[my gmail address here]>',
'"Oren2" <[my other gmail address]>',
'Some Subject',
'Message here'
);
//Closes cleanly... works without this but it's not as polite.
$mailer->close();
} else {
echo "The mailer failed to connect. Errors: <pre>".print_r($mailer->errors, 1)."</pre><br />
Log: <pre>".print_r($mailer->transactions, 1)."</pre>";
}
?>I thought maybe it was a problem with the server or something so I downloaded PHPMailer and tried it too, guess what... It worked - which means that the server is fine and it must be something with Swift and how I used it.
At the beginning of this post I described step by step what I did and in which order so, if anyone can help, that would be great
Any help is welcome.