473,395 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

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

Similar topics

4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
20
by: Adrian | last post by:
What does this error mean? Could not access CDO Message Object. Many thanks.
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
5
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to...
0
by: samikdut | last post by:
I have downloaded the Dot Net Framework ver 1.1 from the following location: http://download.microsoft.com/download/5/2/0/5202f918-306e-426d-9637-d7ee26fbe507/setup.exe. I have installed the new...
3
by: pmud | last post by:
Hi, I have ab ASP.Net Application in which I need to send e-mail on button click. Even though my C# code for that is correct.I am getting the following error:: I think the following error can be...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
1
by: maflatoun | last post by:
Hi everyone, I'm coverting some of our code here from the old way of send email in ..net 1.1 to the new .net 2.0. However, everyone I switch the code the new method there is a delay of 1-2...
1
by: les | last post by:
I'm getting this error "BC30456: 'IsBodyHtml' is not a member of 'System.Net.Mail.SmtpClient'" when trying to submit a form and send email. If I remove the line "MailObj.IsBodyHtml = True" the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.