Connect-EmailCmdlet

Parameters   Output Objects   Config Settings  

The Connect-Email cmdlet is used to create a persistent connection object.

Syntax

$cnn = Connect-Email [parameters]

Remarks

This cmdlet allows you to create a persistent connection object to be used with related cmdlets.

When executing the cmdlet a connection object is returned. Pass this object to the Connection parameter of related cmdlets to use the newly created connection object.

To disconnect call Disconnect-Email.

Parameter List


The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.

LogFileThe location of a file to which debug information is written.
AuthMechanismThe authentication mechanism to be used when connecting to the mail server.
CertPasswordThe password to the certificate store.
CertStoreThe name of the certificate store for the client certificate.
CertStoreTypeThe type of certificate store for the client certificate.
CertSubjectThe subject of the certificate used for client authentication.
ConfigSpecifies one or more configuration settings.
CredentialThe PSCredential object to use for user/password authentication.
FirewallHostName or IP address of firewall.
FirewallPasswordA password if authentication is to be used when connecting through the firewall.
FirewallPortThe port of the firewall to which to connect.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
ForceForces the component to accept the default behavior instead of querying the user.
LocalIPThe IP address of the local interface to use.
LogFileThe location of a file to which debug information is written.
PasswordThe password to use for authentication.
PortThe TCP port in the remote host to which to connect.
ServerThe address of the Server.
SSLDetermines how the component starts SSL negotiation.
SSLAcceptThe encoded public key of the certificate which is to be trusted explicitly.
TimeoutThe maximum time allowed for the operation.
UserThe username to use for authentication.

Output Objects


The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.

EmailConnectionThe connection object.

Config Settings


The following is a list of config settings for the cmdlet with short descriptions. Click on the links for further details.

AllowEmptyToIf set to True, then the SendTo property is not required.
AuthorizationIdentityThe value to use as the authorization identity when SASL authentication is used.
CharsetWhen set, the message headers will be encoded using the specified Charset.
HelloThe argument for HELO (herald) command to the server (defaults to local host name).
KeepQueueIf set to True, queued files are not deleted after a successful send.
MaxHeaderLengthMaximum length for headers to avoid line folding (default 80).
MessageHeadersStringString representation of RFC822-encoded headers of the message.
MessageIdAlgorithmDetermines the algorithm used to hash the random MessageId.
OtherHeadersAn RFC 822 compliant string consisting of extra headers.
ReturnPathSets the Return-Path to be used for sending email.
SendRSETWhether to send RSET command.
StopOnBccErrorsInstructs the component to stop sending the message if the server does not acknowledge any of the BCCs.
StopOnCcErrorsInstructs the component to stop sending the message if the server does not acknowledge any of the CCs.
StopOnToErrorsInstructs the component to stop sending the message if the server does not acknowledge any of the TOs.
TransferTextString representation of RFC822-encoded body of the message.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the component whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the component binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
MaskSensitiveWhether sensitive data is masked in log messages.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

LogFile Parameter (Connect-Email Cmdlet)

The location of a file to which debug information is written.

Syntax

Connect-Email -LogFile string

Remarks

When specified, the cmdlet will log debug information to the file. If the file exists, the information will be appended.

Default Value

null

Attachment Parameter (Connect-Email Cmdlet)

The path to any files which are to be attached to the message.

Syntax

Connect-Email -Attachment string[]

Remarks

Default Value

null

AuthMechanism Parameter (Connect-Email Cmdlet)

The authentication mechanism to be used when connecting to the mail server.

Syntax

Connect-Email -AuthMechanism string

Remarks

Default Value

0

BCC Parameter (Connect-Email Cmdlet)

A comma separated list of addresses for blind carbon copies (optional).

Syntax

Connect-Email -BCC string

Remarks

Default Value

""

CC Parameter (Connect-Email Cmdlet)

A comma separated list of addresses for carbon copies (optional).

Syntax

Connect-Email -CC string

Remarks

Default Value

""

CertPassword Parameter (Connect-Email Cmdlet)

The password to the certificate store.

Syntax

Connect-Email -CertPassword string

Remarks

Default Value

""

Parameter Alias

CertificatePassword

CertStore Parameter (Connect-Email Cmdlet)

The name of the certificate store for the client certificate.

Syntax

Connect-Email -CertStore string

Remarks

Default Value

"MY"

Parameter Alias

CertificateStore

CertStoreType Parameter (Connect-Email Cmdlet)

The type of certificate store for the client certificate.

Syntax

Connect-Email -CertStoreType string

Remarks

Default Value

0

CertSubject Parameter (Connect-Email Cmdlet)

The subject of the certificate used for client authentication.

Syntax

Connect-Email -CertSubject string

Remarks

Default Value

"*"

Config Parameter (Connect-Email Cmdlet)

Specifies one or more configuration settings.

Syntax

Connect-Email -Config string[]

Remarks

Default Value

null

Credential Parameter (Connect-Email Cmdlet)

The PSCredential object to use for user/password authentication.

Syntax

Connect-Email -Credential PSCredential

Remarks

Default Value

null

Parameter Position

1

Parameter Alias

auth

FirewallHost Parameter (Connect-Email Cmdlet)

Name or IP address of firewall.

Syntax

Connect-Email -FirewallHost string

Remarks

Default Value

""

FirewallPassword Parameter (Connect-Email Cmdlet)

A password if authentication is to be used when connecting through the firewall.

Syntax

Connect-Email -FirewallPassword string

Remarks

Default Value

""

FirewallPort Parameter (Connect-Email Cmdlet)

The port of the firewall to which to connect.

Syntax

Connect-Email -FirewallPort int

Remarks

Default Value

0

FirewallType Parameter (Connect-Email Cmdlet)

Determines the type of firewall to connect through.

Syntax

Connect-Email -FirewallType string

Remarks

Default Value

0

FirewallUser Parameter (Connect-Email Cmdlet)

A user name if authentication is to be used connecting through a firewall.

Syntax

Connect-Email -FirewallUser string

Remarks

Default Value

""

Force Parameter (Connect-Email Cmdlet)

Forces the component to accept the default behavior instead of querying the user.

Syntax

Connect-Email -Force SwitchParameter

Remarks

Default Value

false

From Parameter (Connect-Email Cmdlet)

The email address of the sender (required).

Syntax

Connect-Email -From string

Remarks

Default Value

""

Parameter Position

4

This is a required parameter.

Importance Parameter (Connect-Email Cmdlet)

Importance of the mail message.

Syntax

Connect-Email -Importance string

Remarks

Default Value

0

LocalIP Parameter (Connect-Email Cmdlet)

The IP address of the local interface to use.

Syntax

Connect-Email -LocalIP string

Remarks

Default Value

""

Parameter Alias

LocalAddress

LogFile Parameter (Connect-Email Cmdlet)

The location of a file to which debug information is written.

Syntax

Connect-Email -LogFile string

Remarks

Default Value

""

Message Parameter (Connect-Email Cmdlet)

The full text of the message to be sent (without headers).

Syntax

Connect-Email -Message string

Remarks

Default Value

""

MessageHTML Parameter (Connect-Email Cmdlet)

The full text of the HTML message to be sent (without headers).

Syntax

Connect-Email -MessageHTML string

Remarks

Default Value

""

MessageId Parameter (Connect-Email Cmdlet)

Sets the message Id used by the component.

Syntax

Connect-Email -MessageId string

Remarks

Default Value

"*"

Password Parameter (Connect-Email Cmdlet)

The password to use for authentication.

Syntax

Connect-Email -Password string

Remarks

Default Value

""

Port Parameter (Connect-Email Cmdlet)

The TCP port in the remote host to which to connect.

Syntax

Connect-Email -Port int

Remarks

Default Value

25

ReplyTo Parameter (Connect-Email Cmdlet)

The email address to which replies should be sent.

Syntax

Connect-Email -ReplyTo string

Remarks

Default Value

""

Server Parameter (Connect-Email Cmdlet)

The address of the Server.

Syntax

Connect-Email -Server string

Remarks

Default Value

""

Parameter Position

0

This is a required parameter.

SSL Parameter (Connect-Email Cmdlet)

Determines how the component starts SSL negotiation.

Syntax

Connect-Email -SSL string

Remarks

Default Value

3

SSLAccept Parameter (Connect-Email Cmdlet)

The encoded public key of the certificate which is to be trusted explicitly.

Syntax

Connect-Email -SSLAccept string

Remarks

Default Value

""

Parameter Alias

Accept

Subject Parameter (Connect-Email Cmdlet)

The subject of the email.

Syntax

Connect-Email -Subject string

Remarks

Default Value

""

Timeout Parameter (Connect-Email Cmdlet)

The maximum time allowed for the operation.

Syntax

Connect-Email -Timeout int

Remarks

Default Value

10

To Parameter (Connect-Email Cmdlet)

A comma separated list of addresses for destinations.

Syntax

Connect-Email -To string

Remarks

Default Value

""

Parameter Position

2

User Parameter (Connect-Email Cmdlet)

The username to use for authentication.

Syntax

Connect-Email -User string

Remarks

Default Value

""

EmailConnection Output Object (Connect-Email Cmdlet)

The connection object.

Syntax

Object EmailConnection {
   string AuthMechanism;
   string CertPassword;
   string CertStore;
   string CertStoreType;
   string CertSubject;
   string[] Config;
   PSCredential Credential;
   string FirewallHost;
   string FirewallPassword;
   int FirewallPort;
   string FirewallType;
   string FirewallUser;
   SwitchParameter Force;
   string LocalIP;
   string LogFile;
   string Password;
   int Port;
   string Server;
   string SSL;
   string SSLAccept;
   int Timeout;
   string User;
}

Remarks

This object holds the connection. It may be passed to the Connection parameter of related cmdlets.

Config Settings (Connect-Email Cmdlet)

SMTP Config Settings

Charset:  
Hello:  
KeepQueue:  
SendRSET:  

TCPClient Config Settings

Linger:  
LocalHost:  
LocalPort:  
UseIPv6:  

Socket Config Settings

AbsoluteTimeout:  
FirewallData:  
InBufferSize:  
OutBufferSize:  

Base Config Settings

BuildInfo:  
CodePage:  
LicenseInfo:  
MaskSensitive:  
UseInternalSecurityAPI: