the factories.yml
file details the SMTP details
param:
host: smtp.localhost.com
port: 25
username: aaa@bbb.com
password: 123456
Here the username
is the username used for logging onto the smtp server. Not the email address the email will be sent from.
This line
$message = Swift_Message::newInstance()
->setSubject('sub')
->setFrom('ccc@ddd.com')
determines the from address of the email.