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:
<?php use Inc\Claz\Email; print_r( stream_get_transports()); // Create the Transport $transport = (new Swift_SmtpTransport('sv4.byethost4.org', 290, 'ssl')) ->setUsername('myusername') ->setPassword('mypassword') ; // 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.host = sv4.byethost4.org email.smtp_auth = true email.username = myusername email.password = mypassword email.smtpport = 290 email.secure = 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!!