Reply To: Debugging email


I have been having a long email exchange with the support people at byethost. In the end we could not find the problem but they pointed me to some script example using Switmailer.

Here is the script swiftmailer.php I have written and put in /modules/invoices:

use Inc\Claz\Email;
print_r( stream_get_transports());
// Create the Transport
$transport = (new Swift_SmtpTransport('', 290, 'ssl'))

// Create the Mailer using your created Transport
$mailer = new Swift_Mailer($transport);

// Create a message
$message = (new Swift_Message('The Subject'))
  ->setFrom(['fromemail@mydomain' => 'John Doe'])
  ->setTo(['toemail@myotherdomain' => 'A name'])
  ->setBody('Here is the message itself')

// Send the message
$result = $mailer->send($message);

I then use http://myserver/index.php?module=invoices&view=swiftmail to execute it.
and it works. The email is sent and received.

Now if I set the custom.config.php to use the same data like this                          =
email.smtp_auth                     = true
email.username                      = myusername
email.password                      = mypassword
email.smtpport                      = 290                        = ssl
email.ack                           = false
email.use_local_sendmail            = false

if I then try to send an email the normal then it fails with the Timed Out error!

I don’t understand!!