< Back

Send-Email

Sat Jan 11, 2020 2:47 pm

NAME Send-Email



SYNOPSIS

This function sends an email containing optional attachments.





SYNTAX

Send-Email -emailCredentials <PSCredential> -smtpServer <String> -portNumber <Int32> -destinationEmailAddress

<String> -emailSubject <String> -emailBody <String> -attachmentFilePaths <PSObject[]> [<CommonParameters>]



Send-Email -emailCredentials <PSCredential> -smtpServer <String> -portNumber <Int32> -destinationEmailAddress

<String> -emailSubject <String> -emailBody <String> [-attachmentFilePath <String>] [<CommonParameters>]





DESCRIPTION

This function sends an email containing optional attachments.

It returns if the email was sent successfully.





PARAMETERS

-emailCredentials <PSCredential>

The credentials which will be used to send the email.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-smtpServer <String>

The email smtp server.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-portNumber <Int32>

The port number on the email smtp server.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-destinationEmailAddress <String>

The destination email address which the email will be sent.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-emailSubject <String>

The subject of the email.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-emailBody <String>

The body of the email.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-attachmentFilePaths <PSObject[]>

An array containing the paths of multiple files to attach to the email.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-attachmentFilePath <String>

The path of a single file to attach to the email.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Boolean







RELATED LINKS