$ To = "SomeOtherAddress@whatever.com" $ Cc = "AThirdUser@somewhere.com" $ Attachment = "C: usersUsernameDocumentsSomeTextFile.txt" $ Subject = "Here's the Email Subject" $ Body = "This is what I want to say" $ SMTPServer = "smtp.gmail.com" $ SMTPPort = "587" Send-MailMessage -From $ From -to $ To -Cc $ Cc -Subject $ Subject -Body $ Body -SmtpServer $ SMTPServer -port $ SMTPPort -UseSsl -Credential (Get-Credential) -Attachments $ Attachment –DeliveryNotificationOption OnSuccess
Step 3: If using Yahoo mail, the server is smtp.mail.yahoo.com and the port is 465 . For Outlook, the server is smtp-mail.outlook.com with port 587 .
Step 4: You can remove Attachment and CC if you don't need them and also delete them in the Send-MailMessage line.
Step 5: Use -UseSsl to make sure email is safe. You can also add -DeliveryNotificationOption OnSuccess if you want to receive confirmation that the message has been sent successfully.
Step 6: When running the command, it will prompt you to enter a username and password (Get-Credential) . Enter this information and your email will be sent.
This is another way to send an email, see the Guide to Email Automatically in Google Sheet with Google Script.
I wish you all success!
See more:
Send email with another Gmail account
Quickly view email sender information on Gmail with Gmail Sender Icons
How to send email to self-destruct within 5 minutes on Gmail
windows 7 has added powershell, a more powerful command line and script language. since windows 7, powershell has become more prominent, even becoming the default choice in windows 10. how is it different from command prompt?
many people like to use powershell because it allows them to do things that can't be done with the windows gui. however, it is undeniable that some powershell cmdlets can be tedious or complicated. but what if there is a way to edit these cmdlets and get them to 'behave' the way you want?
software like thunderbird and outlook make sending emails magical. but who knows, your email may not reach where it needs to go. how do you know what happens after you click the 'send' button? one way is to try sending emails from the email service provider's external server using telnet - a small application built into the computer. you will receive an error message if the email software does not send the message.
many people will wonder why they need an anonymous email service while there are many great and free email services like gmail, outlook, yahoo! mail. privacy and anonymity are the answers.
windows 10 comes with windows powershell 5.0. windows powershell is a task-based command-line shell and scripting language specifically designed for system administration. this tutorial will show you how to add or remove 'open powershell window here as administrator' on windows 10 right-click menu.
windows powershell is a command executive command system and script scripting language that you can use to manage your system. in the following article, network administrator will show you 10 powershell commands to manage your computer remotely effectively.
one of the fastest ways for you to email a group on your iphone is to create a contact with an email group that you email regularly, such as a business exchange.
what is powershell basic commands in powershell. first of all, to understand it briefly, powershell is a command-line interface similar to cmd, it can do everything cmd can do and even more. powershell is gradually becoming the default