troubleshooting Question

MailMessages linking...

Avatar of Matb396
Matb396 asked on
.NET ProgrammingVisual Basic.NET
3 Comments1 Solution267 ViewsLast Modified:
Hi All

I have a vb.net program that has the following code:
 

  Public Sub sendmailto(ByVal toemail As MailAddress)
Dim reMail As New MailMessage
        reMail = Me.email
        reMail.To.Add(toemail)
***then a load of other stuff***
End Sub

me.email is a property within this class:

    Private_mail As New MailMessage
    Public Property email() As MailMessage
        Get
            Return _mail
        End Get
        Set(ByVal value As MailMessage)
            _mail = value
        End Set
    End Property

why is that when i change something on reMail (e.g.reMail.To.Add(toemail)) the me.email updates aswell?

Anyideas?

Cheers
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros