Available Methods for Sending Messages

The Mailer class offers two methods for sending Messages – send() and batchSend(). Each behaves in a slightly different way.

When a message is sent in Swift Mailer, the Mailer class communicates with whichever Transport class you have chosen to use (see Transport Types).

Each recipient in the message should either be accepted or rejected by the Transport. For example, if the domain name on the email address is not reachable the SMTP Transport may reject the address because it cannot process it. Whichever method you use – send() or batchSend() – Swift Mailer will return an integer indicating the number of accepted recipients.

Note: It's possible to find out which recipients were rejected – we'll cover that later in this chapter.

NOTE: Documentation for version 3 is in the wiki.