I am trying to use the send-mailmessage in powershell by passing through data using variables. I have cut down the script to simplest form so i can get it to work however i get errors " The specified string is not in the form required for an e-mail address"
Any thoughts please ?
$email = ‘email@example.com’
$data = ‘This is a test’
Send-MailMessage To $email -subject $subject -Body $data -From $email -SmtpServer $smtpServer
Thanks in advance