INFORMATICS

The Best

Przełącznik języka

Zaproś mnie na KAWE

Jeżeli podoba Ci się strona i chcesz wspomóc projekt!

Postaw mi kawę na buycoffee.to

This Site

Płatnik

CMS

Hardware

Uncategorised

Emulators

Powershell

Storage Array

DNS

Antivirus program

Licznik

3.png3.png7.png9.png0.png5.png9.png
Today1569
Yesterday1662
This week8982
This month7617
Total3379059

Visitor Info

  • IP: 10.2.33.15
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

6
Online

piątek, 05 grudzień 2025 21:38

send e-mail just a script PowerShell Send-MailMessage

Ocena użytkowników: 5 / 5

Gwiazdka aktywnaGwiazdka aktywnaGwiazdka aktywnaGwiazdka aktywnaGwiazdka aktywna
 

send e-mail just a script PowerShell
Send-MailMessage

help send-MailMessage:

NAME
    Send-MailMessage

SYNTAX
    Send-MailMessage [-To] <string[]> [-Subject] <string> [[-Body] <string>] [[
    -SmtpServer] <string>] -From <string> [-Attachments <string[]>] [-Bcc <stri
    ng[]>] [-BodyAsHtml] [-Encoding <Encoding>] [-Cc <string[]>] [-DeliveryNoti
    ficationOption <DeliveryNotificationOptions> {None | OnSuccess | OnFailure
    | Delay | Never}] [-Priority <MailPriority> {Normal | Low | High}] [-Creden
    tial <pscredential>] [-UseSsl] [-Port <int>]  [<CommonParameters>]


ALIASES
    None


REMARKS
    Get-Help cannot find the Help files for this cmdlet on this computer. It is
     displaying only partial help.
        -- To download and install Help files for the module that includes this
     cmdlet, use Update-Help.
        -- To view the Help topic for this cmdlet online, type: "Get-Help Send-
    MailMessage -Online" or

go to http://go.microsoft.com/fwlink/?LinkID=135256.

Send mail:

type powershell send-mailmessage

cmdlet Send-MailMessage at command pipeline position 1

Supply values for theh following parameteres:

From:

Subject:

To[0]:

sample script:

$sender = “Ten adres pocztowy jest chroniony przed spamowaniem. Aby go zobaczyć, konieczne jest włączenie w przeglądarce obsługi JavaScript.
$receiver = “Ten adres pocztowy jest chroniony przed spamowaniem. Aby go zobaczyć, konieczne jest włączenie w przeglądarce obsługi JavaScript.
$subject = “test email from powershell”
$content = “content email from powershell.”
$server_smtp = “smtp.domena.pl”
 
Send-MailMessage -SmtpServer $server_smtp -From $sender -To $receiver -Subject $subject -Body $content

 

 

Search