Link to home
Start Free TrialLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

SendEmail error in Powershell- SendEmail no longer works

SendEmail was working just fine today and then all at once I got this message:

SendEmail : The term 'SendEmail' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:5
+     SendEmail $SendTo $MailSubject $htmlOutput
+     ~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (SendEmail:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

SendEmail is not a PowerShell command (all PowerShell commands have the syntax <verb>-<noun>, such as Send-EmailMessage). One possibility ... You might have had SendEmail in your PowerShell profile, and for some reason, your profile is not loading properly, or got corrupted.
http://freshmeat.sourceforge.net/projects/sendemail/ is a standalone script.

Likely problem is this script is missing from your machine now or your $PATH is missing the directory where the sendemail script lives.

Likely Fix: Search around + see if the script exist, if it does, arrange for it's directory to live in $PATH.

Also... the sendEmail script is very old. No changes since 2009, by original author.

Better to switch to SWAKS which is under continual development + likely works far better than sendEmail at this point.
Random Note: As delivered this script is always named sendEmail, notice the starting "s" is lowercase, rather than uppercase, so the solution may be as simple as lower casing the first "s".
Case in commamds does not matter for PowerShell.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.