Skip to main content

I'm trying to run Send-MailMessageSend-MailMessage directly from a command window.

c:>powershell Send-MailMessage -from '[email protected]' -to "[email protected]" -subject 'test' -smtpServer "srv.server.com" -Attachment c:\Test\log.txt -body "Test message"C:\>powershell Send-MailMessage -from '[email protected]' -to "[email protected]" -subject 'test' -smtpServer "srv.server.com" -Attachment c:\Test\log.txt -body "Test message"

This fails with

Send-MailMessage : A positional parameter cannot be found that accepts argument 'from'.Send-MailMessage : A positional parameter cannot be found that accepts argument 'from'.

I'm sure it's possible. I just dont know how to pass the arguments correctly.

I'm trying to run Send-MailMessage directly from a command window.

c:>powershell Send-MailMessage -from '[email protected]' -to "[email protected]" -subject 'test' -smtpServer "srv.server.com" -Attachment c:\Test\log.txt -body "Test message"

This fails with

Send-MailMessage : A positional parameter cannot be found that accepts argument 'from'.

I'm sure it's possible. I just dont know how to pass the arguments correctly.

I'm trying to run Send-MailMessage directly from a command window.

C:\>powershell Send-MailMessage -from '[email protected]' -to "[email protected]" -subject 'test' -smtpServer "srv.server.com" -Attachment c:\Test\log.txt -body "Test message"

This fails with

Send-MailMessage : A positional parameter cannot be found that accepts argument 'from'.

I'm sure it's possible. I just dont know how to pass the arguments correctly.

Source Link
Henno
  • 3
  • 2
  • 3

Send-MailMessage parameter from command prompt

I'm trying to run Send-MailMessage directly from a command window.

c:>powershell Send-MailMessage -from '[email protected]' -to "[email protected]" -subject 'test' -smtpServer "srv.server.com" -Attachment c:\Test\log.txt -body "Test message"

This fails with

Send-MailMessage : A positional parameter cannot be found that accepts argument 'from'.

I'm sure it's possible. I just dont know how to pass the arguments correctly.