Reputation: 44385
I am trying to repeat the example of creating an email with inline images as shown here, but I encounter an error when using a variable $SmtpSender
in the From
element. The code is as follows:
$msg = new-object Net.Mail.MailMessage
$msg.From = "<a href="$SmtpSender">$SmtpSender</a>"
and the error is here:
Unrecognized token in source text.
At D:\Testing\Data\Powershell\LoadRunner\LRmain.ps1:82 char:13
+ $msg.From = <<<< "<a href="$SmtpSender">$SmtpSender</a>"
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnrecognizedToken
The variable $SmtpSender
is defined. How to fix this problem?
Upvotes: 1
Views: 1230