469,602 Members | 1,740 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

SmtpMail

Hi

just a really quick simple question. Can you configure SmtpMail class in C#
to use a different port? or does it have to be port 25?

Thanks
Jason
Nov 16 '05 #1
7 3594
Hello,

No, it is not possible. You can use the System.Web.Mail namespace instead.
Here's an example for you:

http://www.codeproject.com/dotnet/Sy..._SMTP_AUTH.asp

Good Luck!

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Jason" <c_*******@mighty.co.za> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
Hi

just a really quick simple question. Can you configure SmtpMail class in C# to use a different port? or does it have to be port 25?

Thanks
Jason

Nov 16 '05 #2
Not sure why you say 'No' while the answer is Yes. The SmtpMail class is
part of the System.Web.Mail namespace.
Am I missing something?

Willy.
"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
Hello,

No, it is not possible. You can use the System.Web.Mail namespace instead.
Here's an example for you:

http://www.codeproject.com/dotnet/Sy..._SMTP_AUTH.asp

Good Luck!

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Jason" <c_*******@mighty.co.za> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
Hi

just a really quick simple question. Can you configure SmtpMail class in

C#
to use a different port? or does it have to be port 25?

Thanks
Jason


Nov 16 '05 #3
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.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:uA**************@TK2MSFTNGP12.phx.gbl...
Not sure why you say 'No' while the answer is Yes. The SmtpMail class is
part of the System.Web.Mail namespace.
Am I missing something?

Willy.
"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
Hello,

No, it is not possible. You can use the System.Web.Mail namespace instead. Here's an example for you:

http://www.codeproject.com/dotnet/Sy..._SMTP_AUTH.asp

Good Luck!

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Jason" <c_*******@mighty.co.za> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
Hi

just a really quick simple question. Can you configure SmtpMail class
in C#
to use a different port? or does it have to be port 25?

Thanks
Jason



Nov 16 '05 #4
"Jason" <c_*******@mighty.co.za> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
just a really quick simple question. Can you configure SmtpMail class in C# to use a different port? or does it have to be port 25?


No - you'd need to use something like aspNetMail for that...
http://www.dotnet247.com/247referenc...26/131288.aspx
Nov 16 '05 #5


"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.
Nov 16 '05 #6
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.

Nov 16 '05 #7
See inline ***

Willy.

"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:et*************@TK2MSFTNGP09.phx.gbl...
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.
*** Please we are not talking about the link to the example. I'm human too,
and I can also make mistakes without being offended when someone points me
to my mistakes.
In my opinon, i answered the question correctly, *** Right, if you add a lot of missing words :-) "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?).
*** No offence taken, but I wasn't replying to OP, I was only pointing to
what, IMO, seems confusing in your reply (remember a few words missing), and
because the example explained it all.

And the answer to the question is not "Yes", as you
*** You have to call SmtpMail.Send with the MailMessage class instance as
argument to set the CDOSYS property that changes the port number, so you
need both SmtpMail and MailMessage, the MailMessage object alone won't be of
no use without SmptMail.Send.

said, because you cannot specify a port number when using the SmtpMail
class.
*** OP's question was if you could "configure SmtpMail to .... , and the
answer is NO "you can't configure the SmtpMail class", but you must use
SmtPMail to configure another port..... (see above).
Maybe we can agree on this and stop this silly discussion.

Sorry...

Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Leszek | last post: by
5 posts views Thread by ElanKathir | last post: by
2 posts views Thread by Edward | last post: by
2 posts views Thread by kmbarz | last post: by
3 posts views Thread by aslantifosi | last post: by
reply views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.