How to Send SMTP Email Using PowerShell

By | October 16, 2020
Send-MailMessage -From 'mert.erdil@merterdil.com ' -To 'info@merterdil.com ' -Subject 'Test mail' -SmtpServer 'smtp.merterdil.com' -Port 25
ParameterDescription
-ToEmail address of a recipient or recipients
-BccEmail address of a BCC recipient or recipients
-CcEmail address of a CC recipient or recipients
-FromSender’s email address
-SubjectEmail subject
-BodyEmail body text
-BodyAsHtmlDefines that email body text contains HTML
-AttachmentsFilenames to be attached and the path to them
-CredentialAuthentication to send the email from the account
-SmtpServerName of the SMTP server
-PortPort of the SMTP server
-DeliveryNotificationOptionThe sender(s) specified in the Form parameter will be notified on the email delivery. Here are the options:None – notifications are off (default parameter) OnSuccess – notification of a successful delivery OnFailure – notification of an unsuccessful delivery Delay – notification of a delayed deliveryNever – never receive notifications
-EncodingThe encoding for the body and subject
-PriorityDefines the level of priority of the message. Valid options are:Normal (default parameter)LowHigh
-UseSslConnection to the SMTP server will be established using the Secure Sockets Layer (SSL) protocol

Leave a Reply

Your email address will not be published. Required fields are marked *