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

'Fields' is not a member of 'System.Web.Mail.MailMessage'

P: n/a
I'm trying to use system.web.mail to send an email, but the smtp
server
requires authentication. I came across some info about fields
property

Dim mail As New MailMessage()
mail.To = "to@address.com
mail.From = "fr**@address.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti
cate", "1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername
", "username") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword
", "password") 'set your password here
SmtpMail.SmtpServer = "smtp.domain.com" 'your real server goes here
SmtpMail.Send(mail)
I get a compilation error:

'Fields' is not a member of 'System.Web.Mail.MailMessage'

Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Techie
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
If you are using VS.NET, that might be the problem. It's using the 1.0
framework.
--
Phil Wilson [MVP Windows Installer]
----
"techie" <as**********@yahoo.com> wrote in message
news:d7**************************@posting.google.c om...
I'm trying to use system.web.mail to send an email, but the smtp
server
requires authentication. I came across some info about fields
property

Dim mail As New MailMessage()
mail.To = "to@address.com
mail.From = "fr**@address.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti cate", "1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername ", "username") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword ", "password") 'set your password here
SmtpMail.SmtpServer = "smtp.domain.com" 'your real server goes here
SmtpMail.Send(mail)
I get a compilation error:

'Fields' is not a member of 'System.Web.Mail.MailMessage'

Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Techie

Nov 18 '05 #2

P: n/a
How can i make VS use the 1.1 framework? how can i remove the compilation error.
I simply cannot go ahead.
"Phil Wilson" <Ph*********@unisys.spamcom> wrote in message news:<#j************@TK2MSFTNGP10.phx.gbl>...
If you are using VS.NET, that might be the problem. It's using the 1.0
framework.
--
Phil Wilson [MVP Windows Installer]
----
"techie" <as**********@yahoo.com> wrote in message
news:d7**************************@posting.google.c om...
I'm trying to use system.web.mail to send an email, but the smtp
server
requires authentication. I came across some info about fields
property

Dim mail As New MailMessage()
mail.To = "to@address.com
mail.From = "fr**@address.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti
cate", "1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername
", "username") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword
", "password") 'set your password here
SmtpMail.SmtpServer = "smtp.domain.com" 'your real server goes here
SmtpMail.Send(mail)
I get a compilation error:

'Fields' is not a member of 'System.Web.Mail.MailMessage'

Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Techie

Nov 18 '05 #3

P: n/a
VSNET uses the 1.0 framework at development time. VS 2003 uses the 1.1
framework - you can't change this. If you must use fields, you must use VS
2003 so you can develop against the 1.1 framework.
--
Phil Wilson [MVP Windows Installer]
----
"techie" <as**********@yahoo.com> wrote in message
news:d7**************************@posting.google.c om...
How can i make VS use the 1.1 framework? how can i remove the compilation error. I simply cannot go ahead.
"Phil Wilson" <Ph*********@unisys.spamcom> wrote in message

news:<#j************@TK2MSFTNGP10.phx.gbl>...
If you are using VS.NET, that might be the problem. It's using the 1.0
framework.
--
Phil Wilson [MVP Windows Installer]
----
"techie" <as**********@yahoo.com> wrote in message
news:d7**************************@posting.google.c om...
I'm trying to use system.web.mail to send an email, but the smtp
server
requires authentication. I came across some info about fields
property

Dim mail As New MailMessage()
mail.To = "to@address.com
mail.From = "fr**@address.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti
cate", "1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername
", "username") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword
", "password") 'set your password here
SmtpMail.SmtpServer = "smtp.domain.com" 'your real server goes here
SmtpMail.Send(mail)
I get a compilation error:

'Fields' is not a member of 'System.Web.Mail.MailMessage'

Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Techie

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.