3 Replies - 1670 Views - Last Post: 29 March 2014 - 12:51 PM Rate Topic: -----

#1 jayhawkfan12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 26-September 13

The parameter 'from' cannot be an empty string

Posted 29 March 2014 - 12:05 PM

I have attached the files with code and the error message. anyone know how to fix this?

sorry by the way I have the commented lines included

Ok, so basically I have a comments form on my website. People but comments in the comment box and it emails the comments to my email. The email part works fine and goes through. However, the error comes when I try to clear the form fields. It gives me an error saying:

Error: The parameter 'from' cannot be an empty string. Parameter name: from

So anyone have any thoughts? like I said the email part works fine its just clearing the fields is giving me trouble

here is the code:

Attached image(s)

  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: The parameter 'from' cannot be an empty string

#2 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6374
  • View blog
  • Posts: 25,756
  • Joined: 12-December 12

Re: The parameter 'from' cannot be an empty string

Posted 29 March 2014 - 12:24 PM

Quote

Error: The parameter 'from' cannot be an empty string. Parameter name: from

I seriously doubt that the error comes from calling ClearFields(). This error is surely from the attempt to send the email.

But you say that it successfully sends the email? Please clarify.

Set a breakpoint and check the values of YourEmail.Text, etc.. (I believe breakpoints can be set in ASP?)

Added: The stack-trace itself confirms the problem is with Send.

The message says "The parameter 'from' cannot be an empty string".

Then it outlines the method call: Send(String from, String recipients, etc..

So.. YourEmail.Text must be an empty string. It's logical, Spock.

This post has been edited by andrewsw: 29 March 2014 - 12:21 PM

Was This Post Helpful? 0
  • +
  • -

#3 jayhawkfan12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 26-September 13

Re: The parameter 'from' cannot be an empty string

Posted 29 March 2014 - 12:33 PM

I ran a breakpoint and it said that the YourEmail.Text value was [email protected] (basically whatever they inputed into the textbox
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6374
  • View blog
  • Posts: 25,756
  • Joined: 12-December 12

Re: The parameter 'from' cannot be an empty string

Posted 29 March 2014 - 12:51 PM

I know nothing about ASP.NET, sorry, although I have a suspicion it might be reading, or attempting to read, details from a webconfig.file, perhaps overwriting YourEmail.Text.

That's the limit of my reasoning ;). Maybe someone else..

Good luck.




I have moved this to the ASP.NET forum.

This post has been edited by andrewsw: 29 March 2014 - 12:53 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1