I am trying to send an email from my gmail ccoiunt in just one single line using windows 8 and powersell. This is the code I use:
Send-MailMessage -smtpServer 'smtp.gmail.com' -port 587 -from '[email protected]' -to '[email protected]' -subject 'Test' -body 'Body' –UseSsl But I don't know how to add the credentials. How can I add username and password to this single code line? (there is no need to encrypt the password).
Thanks