Send Email via Powershell

Welcome Forums General PowerShell Q&A Send Email via Powershell

Viewing 1 reply thread
  • Author
    Posts
    • #277335
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      Trying to send email without getting the username and password prompt

      Able to send email with prompt for password BUT want to get rid of the password prompt.

      $Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $UserName,$Password

      Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -BodyAsHtml -SmtpServer $SMTPServer -Port $SMTPPort -UseSsl -credential $cred -Attachments $Attachment

      Error : New-Object : Cannot find an overload for “PSCredential” and the argument count: “2”.

       

       

    • #277338
      Participant
      Topics: 17
      Replies: 1951
      Points: 3,987
      Helping Hand
      Rank: Community Hero
Viewing 1 reply thread
  • You must be logged in to reply to this topic.