question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SMTP Authentication Credentials before Sending

See original GitHub issue
public 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:closed
  • Created 4 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
mitchelsellerscommented, Oct 6, 2019

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

0reactions
valadascommented, Oct 9, 2019

You are welcome, happy to see it resolved 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to authenticate your SMTP server?
SMTP provides users with two-factor authentication that uses both user credentials as well as a secret code sent via SMS text message.
Read more >
SMTP Authentication: all you need to know
You need to open your mail client, go to the SMTP configuration panel, and flag the option “Authentication Required”. Then choose the type...
Read more >
How to Handle SMTP Authentication
It requires that an email sender (client) must have permission to use the email server. So, only authorized users can send outgoing messages....
Read more >
Enable or disable SMTP AUTH in Exchange Online
SMTP client email submissions (also known as authenticated SMTP submissions or SMTP AUTH) are used in the following scenarios in Office 365 and ......
Read more >
SMTP Authentication & Security: How to Protect Your Email ...
SMTP authentication is a method of securing your email sending. It's when a client logs in using a supported authentication mechanism by the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found