SMTP server port
-
I have a small app that emails me a message every morning. I recently had to change the SMTP port from 25 to 587 on our server due to spam. So I went into the code and changed the SmtpMail.SmtpServer = 192.168.1.15 to 192.168.1.15:587. I am getting this error: The server response was 421 Cannot connect to SMTP server 192.168.1.15 (192.168.1.15:25), connect error 10061. It seems it is still trying to access on port 25. I looked around a bit, but could not find anything on how to change the port it uses. I thought adding the port to the end of the IP address would be sufficient. Thanx in advance
Jude
-
I have a small app that emails me a message every morning. I recently had to change the SMTP port from 25 to 587 on our server due to spam. So I went into the code and changed the SmtpMail.SmtpServer = 192.168.1.15 to 192.168.1.15:587. I am getting this error: The server response was 421 Cannot connect to SMTP server 192.168.1.15 (192.168.1.15:25), connect error 10061. It seems it is still trying to access on port 25. I looked around a bit, but could not find anything on how to change the port it uses. I thought adding the port to the end of the IP address would be sufficient. Thanx in advance
Jude
Hi, Surprised to know that you are still using .Net framework 1.0 / 1.1. In v1.0 or v1.1 you need to set Fields property of MailMessage class's instance for changing default port like this --
objMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", NewServerPort)
NewServerPort will be your port; in your case 587. Also objMessage is instance of MailMessage class. I will recommend you to use .Net 2.0 framework for sending mails, because it exposes appropriate properties for everything related to mails. There is a change in namespace and the new one is - System.Net.Mail. Hope this helps !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
-
Hi, Surprised to know that you are still using .Net framework 1.0 / 1.1. In v1.0 or v1.1 you need to set Fields property of MailMessage class's instance for changing default port like this --
objMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", NewServerPort)
NewServerPort will be your port; in your case 587. Also objMessage is instance of MailMessage class. I will recommend you to use .Net 2.0 framework for sending mails, because it exposes appropriate properties for everything related to mails. There is a change in namespace and the new one is - System.Net.Mail. Hope this helps !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
Thanx a lot! I am not an all day coder. I write little apps and scripts to help me out through the daily grind. I do the tech support work for a small business and my main job is keeping everything running smoothly and handling all the computer problems when they arise. I have .Net 2.0 installed, but how do I use it in VS2003?
Jude
-
Thanx a lot! I am not an all day coder. I write little apps and scripts to help me out through the daily grind. I do the tech support work for a small business and my main job is keeping everything running smoothly and handling all the computer problems when they arise. I have .Net 2.0 installed, but how do I use it in VS2003?
Jude
Hi, I am afraid, but you cannot use .Net Studio 2003 for developing applications on framework 2.0. For that you will need VS.NET 2005 or VS.NET 2008. I think 2008 is a better choice since it can be used to develop applications that target all framework versions. Of course, the choice is yours (rather your company's) Hope this helps.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
-
Hi, I am afraid, but you cannot use .Net Studio 2003 for developing applications on framework 2.0. For that you will need VS.NET 2005 or VS.NET 2008. I think 2008 is a better choice since it can be used to develop applications that target all framework versions. Of course, the choice is yours (rather your company's) Hope this helps.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
Thats what I thought. I installed VS2005 a while back, but it was buggy and a resource hog, so I uninstalled and stuck with 2003. I got a beta disk of VS2008 from MS last month, but have yet to play with it. What about with Monodevelop?
Jude
-
Thats what I thought. I installed VS2005 a while back, but it was buggy and a resource hog, so I uninstalled and stuck with 2003. I got a beta disk of VS2008 from MS last month, but have yet to play with it. What about with Monodevelop?
Jude
TheJudeDude wrote:
resource hog
Just curious about your machine configuration :~
TheJudeDude wrote:
What about with Monodevelop?
I have no idea about Monodevelop. I havent used it yet.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
-
TheJudeDude wrote:
resource hog
Just curious about your machine configuration :~
TheJudeDude wrote:
What about with Monodevelop?
I have no idea about Monodevelop. I havent used it yet.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
Abit VA-20, AMD Barton 2800+, 2GB Corsair DDR 400, 78 GB Raptor. Runs photoshop pretty good, and that is a horse.
Jude