0

I'm using Silex SwiftmailerServiceProvider. Now i need to send an email from my website but i keep getting this error. I searched all over the place but i find only the #110 errors etc.

The code i'm using at the moment:

$message = \Swift_Message::newInstance()
            ->setSubject('[OFFERTE]' . $data['name'])
            ->setFrom(array('fromemail'))
            ->setTo(array('myemail'))
            ->setBody($data['comment'],'text/html');

$app['mailer']->send($message);

This code above is the code inside my page.php (landing page).

$app->register(new Silex\Provider\SwiftmailerServiceProvider(), array(
'swiftmailer.options' => array(
    'host' => 'host',
    'port' => 'port',
    'username' => 'username',
    'password' => 'password',
    'encryption' => null,
    'auth_mode' => null
)
));

The code above here is what's in my bootstrap.php (if you're familiar with silex). Anyone an idea what might be the source of this error?

Thanks!

Pieter-Jan

EDIT: i did fill in the host etc in boostrap.php

PieterJan
  • 105
  • 1
  • 10
  • Are you sure your details are correct (can you open the same connection with `telnet`)? Are you sure your host allows outgoing connections? – Maerlyn Jul 15 '14 at 17:36

1 Answers1

0

For all others who are having the same issue i had...

If you're getting this message you are doing something wrong. The problem i was having is that some data was wrong to make the connection. So triple check the data you need.

PieterJan
  • 105
  • 1
  • 10