I'm currently using SwiftMailer using the following code with no issues:
$transport = Swift_SmtpTransport::newInstance('inboundsmtp.XXXX.com', 25);
$mailer = Swift_Mailer::newInstance($transport);
I'm not sure exactly how the authentication works other than that it's tied to the server - ie that server and/or service account has permissions on the exchange server.
In any case, the code above works, but if I try that in Symfony Mailer:
$mailer = new Mailer(Transport::fromDsn('smtp://inboundsmtp.XXXX.com:25'));
I get the following error:
Uncaught Symfony\Component\Mailer\Exception\TransportException: Unable to connect with STARTTLS
I did, through trial and error, discover that THIS works:
$mailer = new Mailer(Transport::fromDsn('smtp://webmail.XXXX.com:25'));
except when I try to send emails to external addresses I get this error instead:
Expected response code "250/251/252" but got code "550", with message "550 5.7.54 SMTP; Unable to relay recipient in non-accepted domain"
Is there any way I can configure Mailer to use inboundsmtp.XXXX.com? It sounds from the error (STARTTLS) that it's trying to use TLS - and perhaps that's the issue. is there a way to force it not to? I find the documentation for Mailer is nowhere near as clear as SwiftMailer was
Any Help would be appreciated