hello, i am trying to use swift mailer.
I have php 5.04 running on my server. SSL is enabled (if it makes a difference)
The smokes test works if i use "localhost"
I tried using my own server (ip address, smtp.myserver.com & localhost).
I tried using smtp.google.com (using a gmail account created for the occasion)
yet: i keep getting a blank page and nothing shows in my apache log
here is the code I use.
can someone help me out please?
thanks!
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php"
//Start Swift
$smtp = new Swift(new Swift_Connection_SMTP("localhost",25);
$smtp->setUsername("mylogin");
$smtp->setPassword("mypassword");
$swift =& new Swift($smtp);
//Create the message
$message =& new Swift_Message("Title", "Body");
//Now check if Swift actually sends it
if($swift->send($message, "receiver@server.com", "sender@myserver.com"))
{
print "works";
}
else
{
print "didn't work";
}
?>
I used this one with Google
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php"
//Start Swift
$smtp = new Swift(new Swift_Connection_SMTP("smtp.gmail.com", Swift_Connection_SMTP::PORT_SECURE, Swift_Connection_SMTP::ENC_TLS));
$smtp->setUsername("myaccount@gmail.com");
$smtp->setPassword("mygmail_password");
$swift =& new Swift($smtp);
//Create the message
$message =& new Swift_Message("Title", "Body");
//Now check if Swift actually sends it
if($swift->send($message, "receiver@server.com", "sender@myserver.com"))
{
print "works";
}
else
{
print "didn't work";
}
?>
can someone help me please?
thanks!