Asked by:
Translate Powershell authentication String in C#.NET

General discussion
-
Hi everybody,
I look for C#.NET translation of the following Powershell Authentication String. This is to send mail through o365 MX (mydom-com.mail.protection.outlook.c om) using "NT AUTHORITY\ANONYMOUS LOGON" .
No worry my Public IP is trusted in o365 and is add to SPF DNS record for mydom.com...$Password = ConvertTo-SecureString "anyString"-AsPlainText -Force $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "NT AUTHORITY\ANONYMOUS LOGON",$Password
If there is no translation exist, any c#.net code that allow me to send directly through o365 MX is welcome.
Thank you for your help
Orwell
- Changed type Bill_Stewart Wednesday, September 13, 2017 9:04 PM
- Moved by Bill_Stewart Wednesday, September 13, 2017 9:04 PM Possible help vampire
Monday, July 24, 2017 10:18 AM
All replies
-
Send-MailMessage can send through the SMTP port of your O365 account if you have enabled it.
For C# you ill need to post in a C# forum.
\_(ツ)_/
Monday, July 24, 2017 10:30 AM -
Here is an example of how to use SMTP mail with O365 accounts:
$splat = @{ From = 'xx.xx@dom.com' To = 'xx@dom.com' Subject = 'some subject' Body = 'some text' SMTPServer = 'smtp.outlook.com' Port = 587 UseSSL = $true Credentials = Get-Credential 'youro365account' } Send-MailMessage @splat
\_(ツ)_/
Monday, July 24, 2017 10:40 AM -
Thank you JRV.
I know that but this is not for me directly this it's for an developer C#.NET so I need C#.NET code to do this.
This will be in Visual studio C#.NET application.
It seems there is no C# forum in French or English.
I you have link to any forum c# I can post my request on it.
Thank you
Orwell
Monday, July 24, 2017 11:20 AM -
It seems there is no C# forum in French or English.
I you have link to any forum c# I can post my request on it.There is no need to be helpless. You can find information too, if you try. Example:
http://www.google.com/search?&q=C%23+forum
-- Bill Stewart [Bill_Stewart]
Monday, July 24, 2017 2:14 PM