Use the application specific password as the SMTP password when you authenticate.
Application specific passwords are a fallback for those applications that can't use two-step verification.
Question
I am using the PHP mail function to send an email on a contact form that doesn't work on the live server - having checked the logs I see the following :-
Application-specific password required
Clearly I need to setup an Google Application-specific password and have this communicate to my email script. I am going to change the current mail function to use SwiftMailer instead - can anyone explain where I would setup the Application-specific password with the SwiftMailer library to ensure emails are always sent.
Solution
Use the application specific password as the SMTP password when you authenticate.
Application specific passwords are a fallback for those applications that can't use two-step verification.