Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send email not working as expected #54

Open
sarjent opened this issue Jan 15, 2018 · 0 comments
Open

send email not working as expected #54

sarjent opened this issue Jan 15, 2018 · 0 comments

Comments

@sarjent
Copy link

sarjent commented Jan 15, 2018

Receiving the following at the end of execution. I ran the code to generate the password hash and placed it in the xml, configured my smtp information and username as well.

`Saving results to html report: C:\Temp\CTXXDHealthCheck.htm
ConvertTo-SecureString : Input string was not in a correct format.
At C:\Temp\XA-and-XD-HealthCheck.ps1:1528 char:20

  • $pass = $smtpPW | ConvertTo-SecureString -key $smtpKey
    
  •                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [ConvertTo-SecureString], FormatException
    • FullyQualifiedErrorId : System.FormatException,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand

The variable '$pass' cannot be retrieved because it has not been set.
At C:\Temp\XA-and-XD-HealthCheck.ps1:1529 char:73

  • $cred = New-Object System.Management.Automation.PsCredential($smtpUser,$pass)
    
  •                                                                        ~~~~~
    
    • CategoryInfo : InvalidOperation: (pass:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The variable '$cred' cannot be retrieved because it has not been set.
At C:\Temp\XA-and-XD-HealthCheck.ps1:1531 char:82

  • ... TaskMemUnicode($cred.Password)
  •                ~~~~~
    
    • CategoryInfo : InvalidOperation: (cred:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The variable '$cred' cannot be retrieved because it has not been set.
At C:\Temp\XA-and-XD-HealthCheck.ps1:1532 char:18

  • $smtpUserName = $cred.Username
    
  •                 ~~~~~
    
    • CategoryInfo : InvalidOperation: (cred:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The variable '$Ptr' cannot be retrieved because it has not been set.
At C:\Temp\XA-and-XD-HealthCheck.ps1:1533 char:75

  • $smtpPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr)
    
  •                                                                          ~~~~
    
    • CategoryInfo : InvalidOperation: (Ptr:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The variable '$smtpUserName' cannot be retrieved because it has not been set.
At C:\Temp\XA-and-XD-HealthCheck.ps1:1535 char:69

  • $smtpClient.Credentials = New-Object System.Net.NetworkCredential( $smtpUserNam ...
    
  •                                                                    ~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (smtpUserName:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

Exception calling "Send" with "1" argument(s): "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication
Required. Learn more at"
At C:\Temp\XA-and-XD-HealthCheck.ps1:1538 char:1

  • $smtpClient.Send( $emailMessage )
  •   + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : SmtpException`
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant