You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps I just don't know how to accomplish this with the current Mock functionality, but here is an example:
# This function sends an SMTP e-mail.# Set up the SMTP Connection object.$SMTPClient=New-Object System.Net.Mail.SMTPClient
$SMTPClient.Host="smtp.example.com"# Set up the mail message object.$MailMessage=New-Object System.Net.Mail.MailMessage
$MailMessage.From="sender@example.com"$MailMessage.To="recipient@example.com"$MailMessage.Subject="This is the subject"$MailMessage.Body="Example email."$SMTPClient.Send($MailMessage)
Is there any way to Mock the $SMTPClient.Send($MailMessage) method?
The text was updated successfully, but these errors were encountered:
Perhaps I just don't know how to accomplish this with the current Mock functionality, but here is an example:
Is there any way to Mock the $SMTPClient.Send($MailMessage) method?
The text was updated successfully, but these errors were encountered: