Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $gmailServer = "smtp.gmail.com"
- $outlookServer = "smtp.live.com"
- #Send-MailMessage -SmtpServer $emailServer -Subject "asdfaf" -From someemail@gmail.com -To someemail.code@gmail.com -Body "This is a test" -UseSsl true
- #$credential = Get-Credential
- #$googleCredential = Get-Credential
- #$secpasswd = ConvertTo-SecureString "ThePassword" -AsPlainText -Force
- $encrypted = ConvertFrom-SecureString -SecureString $secpasswd
- $encrypted
- $x2 = ConvertTo-SecureString -String $encrypted
- $mycreds = New-Object System.Management.Automation.PSCredential ("someemail.someemail@outlook.com", $x2)
- #$outlookCredential = $credential
- $outlookCredential = $mycreds
- $sender = 'someemail@gmail.com' # 'someemail.someemail@outlook.com'
- $outlookSender = 'someemail.someemail@outlook.com'
- $hotmailSender = 'someemail.someemail@hotmail.co.uk'
- $Content = "I will be absolutely delighted if this xxx does manage to work, as it will be a first no SSL"
- $htmlContent = ConvertTo-Html -Body $Content
- $htmlContent
- #Send-MailMessage -smtpServer smtp.live.com -Credential $credential -Usessl $Content -from 'someemail.someemail@outlook.com' -to 'someemail@gmail.com' -subject 'Testing'
- #Send-MailMessage -smtpServer $emailServer -Credential $googleCredential -Usessl -from $sender -to 'someemail@gmail.com' -subject 'Testing' -BodyAsHtml $Content
- Send-MailMessage -smtpServer $outlookServer -Credential $mycreds -Usessl -from $hotmailSender -to 'someemail.someemail@outlook.com' -subject 'Testing' -BodyAsHtml -Body $Content
- #Send-MailMessage -smtpServer $emailServer -Credential $googleCredential -Usessl $Content -from $sender -to 'someemail@gmail.com' -subject 'Testing'
- #Send-MailMessage -smtpServer $emailServer -Credential $googleCredential -from $sender -to 'someemail@gmail.com' -subject 'Testing' -BodyAsHtml $Content
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement