SMTP Authentication Credentials before Sending
See original GitHub issuepublic static void CreateTestMessage1(string server, int port)
{
string to = "jane@contoso.com";
string from = "ben@contoso.com";
string subject = "Using the new SMTP client.";
string body = @"Using this new feature, you can send an email message from an application very easily.";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(server, port);
// Credentials are necessary if the server requires the client
// to authenticate before it will send email on the client's behalf.
**client.Credentials = CredentialCache.DefaultNetworkCredentials;**
client.Send(message);
}
According to this example client.Credentials = CredentialCache.DefaultNetworkCredentials; should be used to authenticate before it sends email.
How can we make DNN CE do this as an option that you can set a check box for that would push this to the server prior to trying to send the email?
I cannot send email from a server due to being unable to authenticate first on my SSL 465 port. The TLS needs STARTTLS pushed to the mail server so the 587 port is a no go as well.
Regardless SSL=TLS and I would at least like to be able to use SSL port but I need to be able to authenticate the credentials prior to sending mail.
I believe all of the logic is in this file in dnn is here: https://github.com/dnnsoftware/Dnn.Platform/blob/development/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpAppender.cs
Any ideas on where that line should go and how it should look?
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (19 by maintainers)
Top GitHub Comments
This is already supported within DNN when using the NTLM setting. It is using a slightly different method, but it does the same thing: https://github.com/dnnsoftware/Dnn.Platform/blob/development/DNN Platform/Library/Services/Mail/Mail.cs#L148
You are welcome, happy to see it resolved 😃