This project is read-only.

can't connect to smtp server

Topics: ASP.NET 2.0
Nov 21, 2007 at 5:56 PM
Hi All: I have blogengine 1.2 set up as an application inside a top-level website, and it's working fine except I can't configure email settings. I've tried it on two different servers on the same subnet, and both servers are trying to connect to a mailserver on the same subnet.

There are no firewalls that would be blocking the servers from communicating with each other. I have a simple "contact us" form in the parent website that uses System.Net.Mail to send mail without a problem. My network settings are really simple:


(The subnet is whitelisted at the mailserver, so no username/password is required)

Is there any way I can debug what the problem is beyond the exception error message that's being thrown?
Nov 23, 2007 at 11:10 AM
Are you by any chance trying to connect using SSL? If so, try clearing the Enable SSL flag to see if you can connect.
Nov 23, 2007 at 4:20 PM
Hi: No, I'm not trying to use SSL. The mailserver I'm connecting to does not support SSL.

Is there any way to debug the actual error being thrown? That might help me ID the problem.
Dec 3, 2007 at 8:14 PM
Hi: All just pinging the list to see if anyone can help me...I don't see where the code to send the mail actually is, so I can't figure out what's wrong.

I see that there's a private function "SendEmail()" that then calls "Utils.SendMailMessage()", but I'm not sure if that's the System.Net.Mail function that's being called or something else?

It seems like the only place you can enter mailserver parameters is in the admin page, but no combination of those settings seems to work. I see the webserver open a connection to the mailserver, but it closes immediately, which leads me to think the mailserver is returning a non-200 response and the exception is being called...but as I mentioned above, I can get System.Net.Mail to send from this website outside of BlogEngine. Sorry to be so newbie...I just don't know how to debug the problem further?
Dec 3, 2007 at 9:27 PM
Yes, Utils.SendMailMessage() is the method that contains the call to System.Net.Mail. You can put a breakpoint there and run through it to ge the error message. The problem that I see is that there's no catch block in that method. Therefore, you may want to look at either App_Code\Extensions\SendCommentMail.cs where there's a method called Post_CommentAdded() or you can also look at contact.aspx.cs where there's a method called SendMail().
Dec 10, 2007 at 1:39 PM
Interesting...what I discovered was that in the settings, if I tried to use an email address outside of the domain of the blog, it doesn't work, but if I use an email address associated with the domain the blog's in, it does that some sort of internal validation that's going on somewhere?

On a regular aspx page calling, it doesn't matter what email address I specify as the "to" works no matter I presume this isn't something specific to