It would have to be a Google/Apps account. You use the generated app password with your account email address. You do not use your interactive account login password.
-- Espi On Wed, Jul 19, 2017 at 5:47 PM, Michael Leone <oozerd...@gmail.com> wrote: > No, app passwords are not supported for my domain. I think they are > supported for this Gmail account, but not for my domain "mike-leone.com", > it says. Ideally that's the account I want to use, but if I can't, I can't. > > Supposing i get an app password for my oozerd...@gmail.com, how do I use > it? Do I use that app password when sending email, instead of my account > password? > > > On Jul 19, 2017 8:35 PM, "Micheal Espinola Jr" <michealespin...@gmail.com> > wrote: > >> The correct way is to generate an app password for Gmail as well. Do not >> lower your account security. >> >> <http://goog_1551210275> >> >> https://myaccount.google.com/apppasswords >> >> >> -- >> Espi >> >> >> On Wed, Jul 19, 2017 at 5:00 PM, Michael Leone <oozerd...@gmail.com> >> wrote: >> >>> Using Win 10 1607, PSVersion 5.1.14393.1480 >>> >>> I am seriously confused. I want to send an email using Powershell via >>> my Yahoo account. (I would have liked to send via my gmail account, >>> but GMail rejects Powershell connections, unless I reduce the security >>> on my account, which I am unwilling to do. Yahoo provides an "app >>> password", supposedly for situations just like this). >>> >>> So I generated an app password from my Yahoo account, and tried to >>> send a test email like this: >>> >>> $Username = "oozerd...@yahoo.com" >>> $Password = "-Yahoo generated app password-" >>> >>> $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force >>> $Credentials = New-Object System.Management.Automation.PSCredential >>> -ArgumentList $Username, $SecurePassword >>> >>> $RcptTo = "tur...@mike-leone.com.com" >>> $Subject = "Yahoo Test" >>> $Body = "This is a test message" >>> Send-MailMessage -From $Username -To $RcptTo -Subject $Subject -Body >>> $Body -SmtpServer smtp.mail.yahoo.com -Port 587 -UseSsl -Credential >>> $Credentials >>> >>> And yet it still fails: >>> >>> Send-MailMessage : The SMTP server requires a secure connection or the >>> client was not authenticated. The server response was: 5.7.1 >>> Authentication required >>> At C:\Scripts\Send-Email-from-PS1.PS1:27 char:1 >>> + Send-MailMessage -From $Username -To $RcptTo -Subject $Subject -Body >>> ... >>> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> + CategoryInfo : InvalidOperation: >>> (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], >>> SmtpException >>> + FullyQualifiedErrorId : >>> SmtpException,Microsoft.PowerShell.Commands.SendMailMessage >>> >>> >>> What am I missing here? How can I use Powershell to send email via >>> Yahoo mail, preferably using their generated app password? Anyone >>> doing this? >>> >>> How are you sending email from Powershell? >>> >>> >>> >>