views:

126

answers:

2

When I send an email with the PHP Swift mailer to this server: smtp.exchange.example.com like this:

// Load transport
$this->transport =
    Swift_SmtpTransport::newInstance(
        self::$config->hostname,
        self::$config->port
    )
    ->setUsername(self::$config->username)
    ->setPassword(self::$config->password);

// Load mailer $this->mailer = Swift_Mailer::newInstance($this->transport);

// Initialize message $this->message = Swift_Message::newInstance();

// From $this->message->setFrom(self::$config->from);

// .. Set message etc.

// Send $this->mailer->send($this->message);

I get a strange error back:

Failed to authenticate on SMTP server with username "[email protected]" using 2 possible authenticators

I know for sure that the login info is correct. What can be the problem?

A: 

The server might require some kind of encryption and secure authentication.
see http://swiftmailer.org/docs/smtp-encryption

VolkerK
This is not the problem, thanks anyway. I just emailed the host, i hope they can help me.
VDVLeon
A: 

Strange enough sending emails works again. We did not change anything and the host say they did not either. We think a server restarts or so. It is strange :S

VDVLeon