SmtpMail

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

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
 
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.
 
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
 
Kristofer Gafvert said:
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.
 
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
 
See inline ***

Willy.

Kristofer Gafvert said:
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.
 
Back
Top