473,465 Members | 1,366 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3791
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
2
by: Edward | last post by:
Hello, everybody, I tried to send Email out using ASP.NET, but failed, here is the code of sending: -------------------------------------------------------------------------------- Try...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
2
by: kmbarz | last post by:
I'm trying to expand my horizons here by working through an ASP.Net book. When I do the example that uses: Line 55: Mail.From = "feedback@graymad.com" Line 56: ...
3
by: aslantifosi | last post by:
hi all, My question is about that i use a smpt server which is running on a different machine from my webserver machine. And i can authenticate with a user and password. I use SmtpMail class. i...
19
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.