Signed email using Powershell

Welcome Forums General PowerShell Q&A Signed email using Powershell

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
5 years, 3 months ago.

  • Author
    Posts
  • #10771

    Participant
    Points: 0
    Rank: Member

    Have a script that sends an email report. Need to have the email digitally signed.
    Any way i can send a digitally signed email using Powershell ?

  • #10772

    Keymaster
    Points: 1,759
    Helping HandTeam Member
    Rank: Community Hero

    That gets into a lot of complexity. Using just the native Send-MailMessage, you'd have to construct the signed, multipart MIME body of the message manually, and then PowerShell could definitely send it.

    If you're using the .NET Framework's SMTPClient, you might be able to.

    $cert = # get a certificate object from the CERT: drive
    $smtp = new-object -type system.net.mail.smtpclient
    $smtp.clientcertificates.add($cert)
    

    Something like that. See the conversation at http://www.vistax64.com/powershell/159699-powershell-certificate-encrypted-signed-email.html.

    Also check out http://www.example-code.com/powershell/smtp_sendSignedPfx.asp and see if that helps. It relies on a third-party class, but there's a download link provided.

The topic ‘Signed email using Powershell’ is closed to new replies.