Property in Class

S

shapper

Hello,

I am creating a custom email class and I have a property as follows:

Private _BccCollection As Mail.MailAddressCollection
Public WriteOnly Property BccCollection() As
Mail.MailAddressCollection
Set(ByVal value As Mail.MailAddressCollection)
_BccCollection = value
End Set
End Property

Now I have a function named Email_Send()

Public Function Email_Send()

Dim email As New System.Net.Mail.MailMessage
email.Bcc = _Bcc
...

End Function

I am getting an error in "email.Bcc = _Bcc".

I know I should do something like email.Bcc.Add( addresses )

But if I am passing a collection ...

Maybe I am also following a wrong method to create this.

Can someone help me out?

Thanks,

Miguel
 
C

Cowboy \(Gregory A. Beamer\)

If you are passing a collection, you are correct. You simply overwrite the
inner value (private var). You should still have an Add method, however.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Property 1
Property 0
Control Property. 3
Property is empty. Why? 2
Property 1
Property. 3
Property 1
Setting the value of a Master page's control's property using a property of the Master page 25

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top