I am terrible sorry that i forgot a few words in my message. I am only a
human, and i do misstakes(!) But I gave a link that explained what to use,
and how to use it.
In my opinon, i answered the question correctly, because the question was:
"Can you configure SmtpMail class in C# to use a different port?"
I said: "No, it is not possible"
I then forgot to add the class name in my next sentence, so it became:
"You can use the System.Web.Mail namespace instead"
Instead of the correct:
"You can use the SmtpMail class of the System.Web.Mail namespace instead"
Again, i'm sorry if this offended you or anyone else. Atleast i gave a link
that explained everything, which i cannot see that you did (did you even
answer the question?). And the answer to the question is not "Yes", as you
said, because you cannot specify a port number when using the SmtpMail
class.
Sorry...
--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:ev*************@TK2MSFTNGP09.phx.gbl...
"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl... Can you please tell me how to set the port with SmtpMail? As far as i
know,
it is not possible.
I should of course have said that i was talking about the MailMessage
class
in the System.Web.Mail namespace. Sorry for that. But i provided a link
with
explained code.
--
The question was about a class SmtpMail and you answer with "No, it is not
possible.You can use the System.Web.Mail namespace" but the SmtpMail
class is part of the same namespace, this is confusing and doesn't answer the
question, tough the sample does.
Feel free to disagree, but IMHO a better answer would have been;
You can use "System.Web.Mail MailMessage" class "Fields" properties to
specify an alternate port and use an instance of this class in the
SmtpMail.Send(MailMessage) overload.
Here's an example for you:
....
Willy.