The parameter 'addresses' cannot be an empty string

后端 未结 2 1545
说谎
说谎 2020-12-11 03:08

I am trying to send an email asp.net, using the System.Net.Mail.SmtpClient class.

However I am getting the following exception message:

The parameter         


        
相关标签:
2条回答
  • 2020-12-11 03:43

    This exception is being thrown by the MailAddress constructor. It means you are trying to add an empty string as an email address, which is not valid.

    In this case it means toEmailAddress is an empty string.

    0 讨论(0)
  • 2020-12-11 03:47

    try

    message.To.Add(New MailAddress(toEmailAddress));
    

    and verify the content of the variable "toEmailAddress".

    0 讨论(0)
提交回复
热议问题