Does anyone knows of a way to embed an image to a powershell code sending email using SPUTILITY?

The image can be located on a shared location for that purpose (aka http://example.com/image.jpg)

Current code:

function sendMail
    asnp Microsoft.SharePoint.PowerShell
    $web = Get-SPWeb "http://mysite"
    $sd = new-object System.collections.specialized.stringdictionary

    $sd.add("to","[email protected]")
    $sd.add("Subject","Your new SharePoint site is ready")

    $body = "<font face='ebrima'>Hello</font>"
    $body +="<font face='ebrima'>Hi</font>"



Thanks, Effy.

1 Answer 1


of course you can. you actually don't need to build you dictionary, you can use this method: https://msdn.microsoft.com/en-us/library/ms477270.aspx

public static bool SendEmail(
    SPWeb web,
    bool fAppendHtmlTag,
    bool fHtmlEncode,
    string to,
    string subject,
    string htmlBody,
    bool appendFooter

Image needs to be somewhere where users will be able to access it and then just write your regular HTML.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.