473,394 Members | 1,701 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,394 software developers and data experts.

Using CDO.Message - ReadOnly errors

I'm trying to resolve some error message I'm getting from this code:

Property "To" is "ReadOnly"
objEmail.To = sUserEmail

Proeprty "CC" is "ReadOnly"
objEmail.CC = pUserEmail
---- CODE--------

Protected Sub SendEmail(ByVal sender As Object, ByVal e As
System.EventArgs)

'Send email to sUserID email address from database
Dim sUserEmail As String
sUserEmail = txtsEmailAddress.Text

Dim pUserEmail As String
pUserEmail = txtEmail.Text

'Build Email Message
Dim sMsg As String
sMsg = (txtFname.Text & " " & txtLname.Text & "has requested
information about our web site" & vbCrLf & _
"Here is the contact information they provided:" &
vbCrLf & vbCrlf & _
"First Name: " & txtFname.Text & vbCrlf & _
"Last Name: " & txtLname.Text & vbCrlf & _
"Email Address: " & txtEmail.text & vbCrlf & _
"Email Type: " & ddlEmailType.SelectedItem.Text &
vbCrlf & _
"Telephone: " & txtTelephone.text & vbCrlf & _
"Country: " & ddlEmailType.SelectedItem.Text & vbCrlf &
_
"State: " & ddlState.SelectedItem.Text & vbCrlf & _
"City: " & txtCity.Text & vbCrlf & _
"Zip: " & txtZip.Text & vbCrlf & _
"TimeZone: " & ddlTimeZone.SelectedItem.Text & vbCrlf &
_
"Time To Call: " & ddlTimeToCall.SelectedItem.Text &
vbCrlf & _
"Day To Call: " & ddlDayToCall.SelectedItem.Text &
vbCrlf

Dim objEmail As New MailMessage()
objEmail.To = sUserEmail
objEmail.From = sUserEmail
objEmail.CC = pUserEmail
objEmail.Subject = "Pluginforsuccss - Information
Confirmation"
objEmail.Body = sMsg
objEmail.Priority = MailPriority.High
objEmail.IsBodyHtml = False

Try
Dim SmtpMail As New SmtpClient
SmtpMail.Send(objEmail)
Catch exc As Exception
Response.Write("Send failure: " + exc.ToString())
End Try

End Sub

Nov 2 '07 #1
0 696

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
10
by: GP | last post by:
Is it possible to iterate through all the controls collection and make the textboxes alone as read only.I don't see a readonly property for the Control.Can some one help me in this context? I...
16
by: Dennis | last post by:
I have a class named "myclass" and an arraylist containing elements of type "MyClass". I want to get the value of a property of "MyClass" (a string type) for one of the arraylist elements. I...
1
by: Jumping Matt Flash | last post by:
I'm trying to achieve a property within a class which returns a conditional result dependent on the class members values. I will explain.. Public Class Address Private addrCountry As String...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
1
by: James Black | last post by:
I am dynamically generating a table in IE to display some information. I will probably change it to divs later, but I just want to get it working properly first. In my div I have the following...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
8
by: fniles | last post by:
Can I change the connection time out in VB.Net 2003 and MS Access (using OLEDbConnection) ? When I use Connect Timeout = 60 in the connectionstring, I get an error "Multiple-step OLE DB operation...
8
by: Scott M. | last post by:
I've tried following the simple instructions to be able to use MyServices within C#...Add a project reference to Microsoft.VisualBasic.dll and add: "using Microsoft.VisualBasic.MyServices;" to 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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...
0
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...

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.