troubleshooting Question

SendGrid SMTP Send Mail Message .Net

Avatar of Larry Brister
Larry BristerFlag for United States of America asked on
Visual Basic.NET.NET Programming* SMTP
3 Comments1 Solution257 ViewsLast Modified:
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.AddTo(recipients)
            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.AddUniqueArgs(customArgs)
            myMessage.ReplyTo = tReply
            Dim credentials = New NetworkCredential(sgUsername, sgPassword)
            ' Create a Web transport for sending email.
            Dim transportWeb = New Web(credentials)

SP
ASKER CERTIFIED SOLUTION
Larry Brister
sr. Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

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