By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

HELP: SMTP SmtpMail How do I set a username and password?

P: n/a
The host a client wants to use requires authentication to relay messages.

How do I set the authentication (username/password) before using the
smtpmail.send(mailmessage) method?

Surely this must be a common thing to do. I have been utterly unable to
google an answer.

--Tony Archer
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The mail functionality that the System.Web.Mail class represents doesn't
have authenticated SMTP mail capabilities. You'll need to find another
compoennt in order to send an SMTP server that requires authentication.
Tgere are lots of free ones out there though so that's not a big problem.
There's an open-source SMTP project at:
http://sourceforge.net/projects/opensmtp-net/ that may work nicely.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"T.Archer" <tarcher @t beyondwebsites d0t com> wrote in message
news:eE**************@TK2MSFTNGP11.phx.gbl...
The host a client wants to use requires authentication to relay messages.

How do I set the authentication (username/password) before using the
smtpmail.send(mailmessage) method?

Surely this must be a common thing to do. I have been utterly unable to
google an answer.

--Tony Archer

Nov 19 '05 #2

P: n/a
Actually, I believe that there is a way, but you have to specify the headers
manually.

For an example, see;
http://www.paulsadowski.com/WSH/cdo.htm

'==This section provides the configuration information for the remote SMTP
server.

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =
cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"youruserid"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"yourpassword"
However, Mark's recommendation is best; there are a number of solid
..NET-specific email components out there with fantastic capabilities.
You'll probably be better off avoiding CDO.

/// M


"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:uY**************@TK2MSFTNGP12.phx.gbl...
The mail functionality that the System.Web.Mail class represents doesn't
have authenticated SMTP mail capabilities. You'll need to find another
compoennt in order to send an SMTP server that requires authentication.
Tgere are lots of free ones out there though so that's not a big problem.
There's an open-source SMTP project at:
http://sourceforge.net/projects/opensmtp-net/ that may work nicely.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"T.Archer" <tarcher @t beyondwebsites d0t com> wrote in message
news:eE**************@TK2MSFTNGP11.phx.gbl...
The host a client wants to use requires authentication to relay messages.
How do I set the authentication (username/password) before using the
smtpmail.send(mailmessage) method?

Surely this must be a common thing to do. I have been utterly unable to
google an answer.

--Tony Archer


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.