We help IT Professionals succeed at work.
Get Started

SendGrid SMTP Send Mail Message .Net

Last Modified: 2017-03-25
I am getting the following message on my ReplyTo line below.

Value of type 'MailAddress' cannot be converted to 'MailAddress()'.
Without that mail sends perfectly fine however.

Little help?
            Dim recipients As New List(Of [String])() From {Emailx + ""}
            Dim customArgs As New Dictionary(Of String, String)()
            customArgs.Add("campaign_id", "ewCID9999")
            customArgs.Add("Customer_ID", "ewCUSID123")

            Dim myMessage = New SendGridMessage()
            myMessage.From = New MailAddress(fromAddress) 'fromAddress
            Dim tReply = New MailAddress("myaddress@mydomain.com")

            myMessage.Subject = "TEST NEW USER"
            myMessage.Html = "TEST HTML <br /><br /><br />LB"
            myMessage.ReplyTo = tReply
            Dim credentials = New NetworkCredential(sgUsername, sgPassword)
            ' Create a Web transport for sending email.
            Dim transportWeb = New Web(credentials)

Open in new window

Watch Question
sr. Developer
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE