I've had a few emails asking how PHPMailer Pro's automated transportation type work.
PHPMailer Pro defaults to using SMTP (un-authenticated). You do not have to specify the server or the port. Although you can specify those, PHPMailer Pro check MX records to identify the server. The port is a bit easier ... the most widely used port is 587. There are four ports checked, in this order: 587, 25, 2525, and finally 465. It's unlikely to ever reach 465 and that's good since most providers no longer use that port.
SMTP un-authenticated? Isn't that risky? For decades we have used PHP Mail() and Sendmail to transport emails. Both are un-authenticated. SMTP is no different – let's not forget that the server already prevents relaying. The only way to get un-authenticated emails through any server is to be using email addresses for sender, reply-to, and return-path that are the same domain as the account being used. In that regard, it is some basic authenticaiton.
The order of priority for transport is first SMTP, then Sendmail, then IMAP, and then - finally - mail(). IMAP and mail() are "wrappers" for Sendmail. Sendmail is now synonymous for Qmail and others ... all the parameters are now abstracted so all work from one code base.
The way PHPMailer Pro works with these different transport types is to first try to send the email through SMTP. If that fails, it then tries Sendmail. If Sendmail fails, then IMAP is the next choice. And if IMAP fails, then the last possibility is mail(). If all four transport types fail, PHPMailer Pro generates the errors and fails to send – putting its error log in the \Exception error stream.
A fifth type is possible, that is SMTP with authentication. All that is needed is the SMTP Username and SMTP Password to enable this.
A question that arises from this explanation is that automation is great, but how can I specificy to go directly to Sendmail?
PHPMailer Pro adds a new parameter to the Send operation. You can specify the transport you want to use in your script. Just set:
$mail->Send('sendmail');
and PHPMailer Pro will go directly to the Sendmail transport for sending emails. If Sendmail fails, then PHPMailer Pro will attempt IMAP, followed by mail().