can someone maybe explain to me how the reply to property works, i want to give it an email address like this "message.replyto("ReplyAdd")", but it doesnt seemd to work. and the replytolist in the code also dont work i get this error when i put in breakpoint on it "count = (count) threw an exception of type system.typeloadexception replytolist"

 Dim client1 As New SmtpClient("smtp.address")
        Dim smtpuserinfo1 As New NetworkCredential("email address", "password")
        client1.Credentials = smtpuserinfo1

        Dim toAddr1 As New MailAddress("email address")
        Dim fromAddr1 As New MailAddress("email address")
        Dim ReplyAdd As New MailAddress("email address")

        Dim message1 As New MailMessage(fromAddr1, toAddr1)

        message1.Subject = "abc"
        message1.Body = "abc"
        message1.Body &= vbCrLf
        message1.Body &= vbCrLf
        message1.Body &= "abc"
        message1.Body &= vbCrLf
        message1.Body &= vbCrLf
        message1.Body &= "abc"
        'message1.ReplyToList.Add(New MailAddress("email address"))
        'Attachement
         Dim attachment As Attachment = New Attachment(Session("filePath2") & "Letter(" & Session("ClientID") & ").pdf")
          message1.Attachments.Add(attachment)

        Try
            client1.Send(message1)

        Catch ex As Exception

        End Try

Recommended Answers

All 4 Replies

As per Microsoft's documentaion found here - that property is obsolete.

ReplyTo Obsolete. Gets or sets the ReplyTo address for the mail message.

A quick google session reveals you may be able to do this as follows:

message1.Headers.Add("Reply-To","a@a.a")

if have tried that headers.add, it doesnt work

what else can i use that might work

Do you receive an error when using Headers.add?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.