471,319 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

smtp server need authentication

Hi all

I try to send email by smtp server.
But, my smtp server need authentication !
How can I do it?
with thanks

Motis

Feb 13 '06 #1
4 8740
as far as I know the built in .net object does not support this, you
need a third party tool

Feb 13 '06 #2
Hello, motis!

how do you send your email? using networking or SmtpClient?
If you use SmtpClient look at Credentials property.

here is sample code

string to = "ja**@contoso.com";
string from = "be*@contoso.com";
string subject = "Using the new SMTP client.";
string body = @"Using this new feature, you can send an e-mail message from an application very easily.";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(server, port);
// Credentials are necessary if the server requires the client
// to authenticate before it will send e-mail on the client's behalf.
client.Credentials = CredentialCache.DefaultNetworkCredentials;

client.Send(message);
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 13 '06 #3
Hi Vadym

I need a user name and password...
like

client.Credentials = XXXXX.user name
client.Credentials = XXXXX.password

Can you help...?

Moti

"Vadym Stetsyak" wrote:
Hello, motis!

how do you send your email? using networking or SmtpClient?
If you use SmtpClient look at Credentials property.

here is sample code

string to = "ja**@contoso.com";
string from = "be*@contoso.com";
string subject = "Using the new SMTP client.";
string body = @"Using this new feature, you can send an e-mail message from an application very easily.";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(server, port);
// Credentials are necessary if the server requires the client
// to authenticate before it will send e-mail on the client's behalf.
client.Credentials = CredentialCache.DefaultNetworkCredentials;

client.Send(message);
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot

Feb 13 '06 #4
Hi all

I need to do:

client.Credentials = new System.Net.NetworkCredential("user", "password");

with thanks to you all

Moti

"motis" wrote:
Hi Vadym

I need a user name and password...
like

client.Credentials = XXXXX.user name
client.Credentials = XXXXX.password

Can you help...?

Moti

"Vadym Stetsyak" wrote:
Hello, motis!

how do you send your email? using networking or SmtpClient?
If you use SmtpClient look at Credentials property.

here is sample code

string to = "ja**@contoso.com";
string from = "be*@contoso.com";
string subject = "Using the new SMTP client.";
string body = @"Using this new feature, you can send an e-mail message from an application very easily.";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(server, port);
// Credentials are necessary if the server requires the client
// to authenticate before it will send e-mail on the client's behalf.
client.Credentials = CredentialCache.DefaultNetworkCredentials;

client.Send(message);
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot

Feb 14 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by dale zhang | last post: by
4 posts views Thread by Tushar | last post: by
5 posts views Thread by Andreas | last post: by
2 posts views Thread by scorpion53061 | last post: by
34 posts views Thread by antonyliu2002 | last post: by
7 posts views Thread by oopsbabies | last post: by
7 posts views Thread by John Drako | last post: by
4 posts views Thread by eruth | last post: by
reply views Thread by rosydwin | last post: by

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.