Email is so basic that most of us don't even think about it. We open the program or σελίδα αλληλογραφίας μας, πληκτρολογούμε το μήνυμα και τον παραλήπτη και απλά πατάμε αποστολή.
A simple automated process that we all know and use.
But you know the alternative ways to send messages email; Yes there are, and today we are going to mention one that exists in Windows.
We'll see how you can send an email using Windows PowerShell. You will need the very powerful Windows PowerShell tool.
Use the following template to send a message through of Gmail. The first lines starting with signalThe dollar signs create the variables needed to send the message, while the Send-MailMessage line is the command that will send your message:
$ From = "email@example.com" $ To = "the_email_of_the_email@that_without.com" $ Cc = "other_receiver@other_mail.com" $ Attachment = "C: \ users \ The_user_name \ Documents \ your_account.txt" $ Subject = "Subject of your message" $ Body = "write your message" $ 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
You can remove attachment lines and CC if you do not need them.
Make sure you also remove them from the Send-MailMessage (-Cc $ Cc and -Attachments $ Attachment) command line.
With the -UseSsl command you will be sure that the message you send will be safely delivered using a secure SSL connection.
The -DeliveryNotificationOption OnSuccess option at the end of the command is used to get a confirmation that your message has been successfully sent.
Once you run the command, you will be prompted for your username and password (Get-Credential).
Type them and your email will leave for the recipient, or the recipients you have specified.