473,499 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Similar topics

1
1166
by: anony | last post by:
Hi, I'm trying to use system.web.mail to send an email, but the smtp server requires authentication. I cam across some info about extra fields allowed via the following: Dim mail As New...
2
1980
by: tma | last post by:
Is there a way to send username and passwords to a mail server using code similar to below? My email server requires a username and password to send mail. Private Sub MailError(ByVal...
3
3004
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
6
2758
by: \jason via DotNetMonster.com\ | last post by:
currently i am doing a personal website and keep on changing the aspect... finally the finall decision is to have a login page (requirement in asp.net, vb.net) and the login with security part of...
11
2007
by: JD | last post by:
Is it possible using the smtp class in asp.net to send emails and authenticate to the mail server that is sending the emails out. Currently I have a web application that works fine on my machine,...
6
4957
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
5
2057
by: Prashant Barnwal | last post by:
Hi, This message i get whne i try to send mails theu my app server. any idea where and what to look for? It works fine in Dev bed. Guide me to apprpriate news group if its not the right place. ...
34
18135
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
4
2346
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
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
7178
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
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
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 project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
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
3103
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
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.