How to use SmtpMail on non-standard port?

  • Thread starter Thread starter Zean Smith
  • Start date Start date
Z

Zean Smith

I have a SMTP server running on port 9025, but seems like this doesn't
work.

SmtpMail.SmtpServer = "192.168.34.15:9025";

SmtpMail.Send( mail );


I couldn't find any properties on SmtpMail let me configure the port number,
any idea?
 
Hi, Zean.

Here's your answer :

C# :
MailMessage mail = new MailMessage();
mail.To = "(e-mail address removed)";
//...etc.
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "9025");


VB.NET :
Dim mail As New MailMessage()
mail.To = (e-mail address removed)
' etc...
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "9025")




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top