Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...CanCan't send emails - smtp is configured correctly
Previous
 
Next
New Post
10/11/2006 11:52 PM
 

I have a problem that I have not been able to solve.

When I send a test email it fails with the following message:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 No AUTH command has been given.

I am using the same credentials that I use for Outlook (my provider requires basic authentication). I have tried adding the credentials to the web.config file and it still does not work. I have searched Microsoft's site for the error message with no luck and nothing that Google spits up seems to apply.

The exception information doesn't really provide any information either.

I can send mail using "old" CDOSYS methods from the same server (supplying credentials of course) so what is wrong or different with .NET or DotNetNuke?

I don't host any smtp servers myself, and don't want to.

ANY help would be greatly appreciated!!!

Mike

 
New Post
10/12/2006 10:27 AM
 

 

If you login as Host, and go to the Host > Host Settings -Advanced Settings - SMTP Server Settings section you can enter you credentials for basic auth there.


DotNetNuke Modules from Snapsis.com
 
New Post
10/12/2006 7:49 PM
 

The problem is with .NET 2.0!

System.Net does not send proper smtp authentication commands, or at least not for the smtp server that I use.

The AUTH LOGIN command is not supposed to be followed by anything however .NET and apparently all of Microsoft's smtp servers send AUTH LOGIN username where username is in base-64. This results in no authentication taking place and as a result I can't send mail. I can however send mail from an ASP page using good-ole CDOSYS.

I had A LOT of trouble finding this information so will include the resources that I finally found here for others.

There is a post on MSDN forums about it which helped me out a great deal.(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=365462&SiteID=1)

First I needed to setup SMTP logging to do this I added the following "code" to the web.config file of my DotNetNuke site. I found this information here: http://www.systemnetmail.com/faq/4.10.aspx (there is an error in the sample they provide)

This has to go AFTER </configSections>.

<system.diagnostics>
  <sources>
   <!-- This section defines the logging configuration for My.Application.Log in Windows Forms projects.-->
   <source name="Microsoft.VisualBasic.Logging.Log.WindowsFormsSource" switchName="DefaultSwitch">
    <listeners>
     <add name="FileLog"/>
     <!-- Uncomment the below section to write to the Application Event Log -->
     <!--<add name="EventLog"/>-->
    </listeners>
   </source>


   <source name="System.Net">
    <listeners>
     <add name="System.Net"/>
    </listeners>
   </source>
   <source name="System.Net.Sockets">
    <listeners>
     <add name="System.Net"/>
    </listeners>
   </source>
   <source name="System.Net.Mail">
    <listeners>
     <add name="System.Net"/>
    </listeners>
   </source>
  </sources>
  <switches>
   <add name="DefaultSwitch" value="Information" />

   <add name="System.Net" value="Verbose" />
   <add name="System.Net.Sockets" value="Verbose" />
   <add name="System.Net.Mail" value="Verbose" />

  </switches>
  <sharedListeners>
   <add name="FileLog"
     type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.1200.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
     initializeData="FileLogWriter"/>

   <add name="System.Net"
        type="System.Diagnostics.TextWriterTraceListener"
        initializeData="System.Net.log"/>

   <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
   <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
  </sharedListeners>

  <trace autoflush="true" />

 </system.diagnostics>

This will result in a file called System.Net.log in the root of your DotNetNuke install.

The log you will get should look something like this (ugly): (Red indicates where the problem is)

System.Net Information: 0 : [1148] Associating MailMessage#11337845 with Message#15010670
System.Net Verbose: 0 : [1148] SmtpClient::.ctor()
System.Net Information: 0 : [1148] Associating SmtpClient#39722444 with SmtpTransport#53537015
System.Net Verbose: 0 : [1148] Exiting SmtpClient::.ctor()  -> SmtpClient#39722444
System.Net Verbose: 0 : [1148] SmtpClient#39722444::Send(MailMessage#11337845)
System.Net Information: 0 : [1148] SmtpClient#39722444::Send(DeliveryMethod=Network)
System.Net Information: 0 : [1148] Associating SmtpClient#39722444 with MailMessage#11337845
System.Net Information: 0 : [1148] Associating SmtpTransport#53537015 with SmtpConnection#63356977
System.Net Information: 0 : [1148] Associating SmtpConnection#63356977 with ServicePoint#40420562
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Socket(InterNetwork#2)
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Socket()
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Connect(18:25#306750871)
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Connect()
System.Net Information: 0 : [1148] Associating SmtpConnection#63356977 with SmtpPooledStream#29918630
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Receive()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Receive
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 32 32 30 20 62 67 6D 70-6F 6D 72 32 2E 73 61 73 : 220 bgmpomr2.sas
System.Net.Sockets Verbose: 0 : [1148] 00000010 : 6B 6E 65 74 2E 73 6B 2E-63 61 20 2D 2D 20 53 65 : knet.sk.ca -- Se
System.Net.Sockets Verbose: 0 : [1148] 00000020 : 72 76 65 72 20 45 53 4D-54 50 20 28 53 61 73 6B : rver ESMTP (Sask
System.Net.Sockets Verbose: 0 : [1148] 00000030 : 54 65 6C 20 65 4D 65 73-73 61 67 69 6E 67 20 53 : Tel eMessaging S
System.Net.Sockets Verbose: 0 : [1148] 00000040 : 65 72 76 69 63 65 29 0D-0A                      : ervice)..
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Receive()  -> 73#73
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Send()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Send
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 45 48 4C 4F 20 62 6B 70-30 31 0D 0A             : EHLO bkp01..
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Send()  -> 12#12
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Receive()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Receive
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 32 35 30 2D 62 67 6D 70-6F 6D 72 32 2E 73 61 73 : 250-bgmpomr2.sas
System.Net.Sockets Verbose: 0 : [1148] 00000010 : 6B 6E 65 74 2E 73 6B 2E-63 61 0D 0A 32 35 30 2D : knet.sk.ca..250-
System.Net.Sockets Verbose: 0 : [1148] 00000020 : 38 42 49 54 4D 49 4D 45-0D 0A 32 35 30 2D 50 49 : 8BITMIME..250-PI
System.Net.Sockets Verbose: 0 : [1148] 00000030 : 50 45 4C 49 4E 49 4E 47-0D 0A 32 35 30 2D 44 53 : PELINING..250-DS
System.Net.Sockets Verbose: 0 : [1148] 00000040 : 4E 0D 0A 32 35 30 2D 45-4E 48 41 4E 43 45 44 53 : N..250-ENHANCEDS
System.Net.Sockets Verbose: 0 : [1148] 00000050 : 54 41 54 55 53 43 4F 44-45 53 0D 0A 32 35 30 2D : TATUSCODES..250-
System.Net.Sockets Verbose: 0 : [1148] 00000060 : 48 45 4C 50 0D 0A 32 35-30 2D 58 4C 4F 4F 50 20 : HELP..250-XLOOP
System.Net.Sockets Verbose: 0 : [1148] 00000070 : 33 41 33 35 45 30 43 41-31 31 44 34 33 32 44 43 : 3A35E0CA11D432DC
System.Net.Sockets Verbose: 0 : [1148] 00000080 : 30 30 30 38 39 46 30 46-43 31 31 43 30 30 35 39 : 00089F0FC11C0059
System.Net.Sockets Verbose: 0 : [1148] 00000090 : 0D 0A 32 35 30 2D 53 54-41 52 54 54 4C 53 0D 0A : ..250-STARTTLS..
System.Net.Sockets Verbose: 0 : [1148] 000000A0 : 32 35 30 2D 41 55 54 48-20 50 4C 41 49 4E 20 4C : 250-AUTH PLAIN L
System.Net.Sockets Verbose: 0 : [1148] 000000B0 : 4F 47 49 4E 0D 0A 32 35-30 2D 41 55 54 48 3D 4C : OGIN..250-AUTH=L
System.Net.Sockets Verbose: 0 : [1148] 000000C0 : 4F 47 49 4E 0D 0A 32 35-30 2D 45 54 52 4E 0D 0A : OGIN..250-ETRN..
System.Net.Sockets Verbose: 0 : [1148] 000000D0 : 32 35 30 20 53 49 5A 45-20 30 0D 0A             : 250 SIZE 0..
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Receive()  -> 220#220
System.Net Verbose: 0 : [1148] SmtpLoginAuthenticationModule#59346840::Authenticate()
System.Net Verbose: 0 : [1148] Exiting SmtpLoginAuthenticationModule#59346840::Authenticate()
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Send()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Send
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 41 55 54 48 20 6C 6F 67-69 6E 20 63 32 6C 74 63 : AUTH login hgjd6
System.Net.Sockets Verbose: 0 : [1148] 00000010 : 44 41 77 4E 77 3D 3D 0D-0A                      : 2pnw3==..
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Send()  -> 25#25
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Receive()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Receive
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 35 30 31 20 35 2E 35 2E-30 20 49 6E 76 61 6C 69 : 501 5.5.0 Invali
System.Net.Sockets Verbose: 0 : [1148] 00000010 : 64 20 69 6E 70 75 74 20-28 49 6E 76 61 6C 69 64 : d input (Invalid
System.Net.Sockets Verbose: 0 : [1148] 00000020 : 20 61 75 74 68 65 6E 74-69 63 61 74 69 6F 6E 20 :  authentication
System.Net.Sockets Verbose: 0 : [1148] 00000030 : 70 72 6F 74 6F 63 6F 6C-29 2E 0D 0A             : protocol)...
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Receive()  -> 60#60
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Send()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Send
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 4D 41 49 4C 20 46 52 4F-4D 3A 3C 6D 69 6B 65 2E : MAIL FROM:<mike.
System.Net.Sockets Verbose: 0 : [1148] 00000010 : 6C 61 76 65 6E 64 65 72-40 73 69 6D 70 6C 79 6F :
lavender@simplyo
System.Net.Sockets Verbose: 0 : [1148] 00000020 : 66 66 73 69 74 65 2E 63-6F 6D 3E 0D 0A          : ffsite.com>..
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Send()  -> 45#45
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Receive()
System.Net.Sockets Verbose: 0 : [1148] Data from Socket#3881099::Receive
System.Net.Sockets Verbose: 0 : [1148] 00000000 : 35 33 30 20 35 2E 37 2E-30 20 4E 6F 20 41 55 54 : 530 5.7.0 No AUT
System.Net.Sockets Verbose: 0 : [1148] 00000010 : 48 20 63 6F 6D 6D 61 6E-64 20 68 61 73 20 62 65 : H command has be
System.Net.Sockets Verbose: 0 : [1148] 00000020 : 65 6E 20 67 69 76 65 6E-2E 0D 0A                : en given...
System.Net.Sockets Verbose: 0 : [1148] Exiting Socket#3881099::Receive()  -> 43#43
System.Net Error: 0 : [1148] Exception in the SmtpClient#39722444::Send - The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 No AUTH command has been given.
System.Net Error: 0 : [1148]    at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
   at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
System.Net.Sockets Verbose: 0 : [1148] Socket#3881099::Dispose()
System.Net Verbose: 0 : [1148] Exiting SmtpClient#39722444::Send()

So the normal SMTP commands should look something like this. Red are my entries Black are the servers response:

ehlo localhost
250-bgmpomr2.sasknet.sk.ca
250-8BITMIME
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-HELP
250-XLOOP 3A35E0CA11D432DC00089F0FC11C0059
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=LOGIN
250-ETRN
250 SIZE 0
auth login
334 VXNlcm5hbWU6
p3ltcAKw89==
334 UGFzc3dvcmQ6
ZcM67Bhyl4==
235 2.7.0 login authentication successful.

Microsoft does things this way

ehlo localhost
250-bgmpomr2.sasknet.sk.ca
250-8BITMIME
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-HELP
250-XLOOP 3A35E0CA11D432DC00089F0FC11C0059
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=LOGIN
250-ETRN
250 SIZE 0
auth login p3ltcAKw89==
501 5.5.0 Invalid input (Invalid authentication protocol)

You can test the problem with your SMTP server by telneting to it.
i.e. telnet yourmailserver.com 25

i hope this helps someone, or at least keeps them from wasting 2 days trying to figure out what the problem is. It also appears to be a problem with the IIS smtp services as well (2000 & 2003 server).

Now all I need is a solution

Mike Lavender
www.simplyoffsite.com Data backup for everyone.
What have you got to lose?

 

 
New Post
10/13/2006 10:14 AM
 

 

Oh, right.  I think Shaun has already fixed this in the core for the next release.  Sorry, I forgot about that one.


DotNetNuke Modules from Snapsis.com
 
New Post
10/20/2006 11:47 AM
 

Hmm, how? Did he write a custom SMTP class or is there a quick fix that I could use?

Mike

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...CanCan't send emails - smtp is configured correctly


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out