smtp server need authentication

G

Guest

Hi all

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

Motis
 
M

mwolf

as far as I know the built in .net object does not support this, you
need a third party tool
 
V

Vadym Stetsyak

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 = "(e-mail address removed)";
string from = "(e-mail address removed)";
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
 
G

Guest

Hi Vadym

I need a user name and password...
like

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

Can you help...?

Moti
 
G

Guest

Hi all

I need to do:

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

with thanks to you all

Moti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top