Good Day
I have been developing a script in Powershell that signs in gmail with the module Gmail.ps and reads the message of a specific email.
Of the emails that I have in the tray I have only been able to capture the subject that I need but do not enter the (Body) message of that subject, is there any way to solve this problem?
I appreciate very much that you can help me.
# Obtiene credenciales seguras del correo electrónico
$SecurePassword = ConvertTo-SecureString -String (Unprotect-String -ProtectedString $PassEmail) -AsPlainText -Force
$Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Email, $SecurePassword
# Entra a gmail para leer el correo
$Gmail = New-GmailSession -Credential $Credentials # Crea una sesión de email
$Subject = "VEE - Nuevo registro de usuario" # Asunto del correo
$Inbox = $Gmail | Get-Mailbox # obtenga la bandeja de entrada
$Sbjt = $Inbox | Get-Message -Unread | Select-Object 'Subject' | Where-Object {$_.Subject -ccontains $Subject}