Add a new post


Name  
Email*  
Subject  
Message
 
 
Protected by Clearscreen.SharpHIPTo prevent abuse from bots, please enter the text you see.:
 

* In order to reduce SPAM, all email addresses will be obfuscated so they cannot be read by spam bots.
For example: 'test@test.com' will become 'test (at) test dot com'.

How do I change the port number?
To change the port number, you will need to chane the http://schemas.microsoft.com/cdo/configuration/smtpserverport field.
The following code snippet demonstrates this technique.

[ C# ]

MailMessage mail = new MailMessage(); 
mail.To = "me@mycompany.com"; 
mail.From = "you@yourcompany.com"; 
mail.Subject = "this is a test email."; 
mail.Body = "Some text goes here"; 
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number"); 
SmtpMail.SmtpServer = "mail.mycompany.com"; 
SmtpMail.Send(mail);

[ VB.NET ]
Dim mail As New MailMessage()
   mail.To = "me@mycompany.com"
   mail.From = "you@yourcompany.com"
   mail.Subject = "this is a test email."
   mail.Body = "Some text goes here"
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number") 'Put port number here

   SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here

   SmtpMail.Send(mail)