参数'address'不能是空字符串。参数名称:地址? [英] The parameter 'address' cannot be an empty string. Parameter name: address ?

查看:440
本文介绍了参数'address'不能是空字符串。参数名称:地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想点击按钮发送邮件。但是它给出的错误是:



Hi,
I am trying to send a mail on button click.But its give an error that is:

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





mail.From =新邮件地址(txtemail.Text);在此行中。

但是如果我在邮箱中的文本框中使用电子邮件ID而不是它的工作。





请给我建议。









谢谢。



mail.From = new MailAddress(txtemail.Text);in this line.
but if i use email id at the place of textbox in mail.From than its work.


please give me suggestion.




Thank You.

推荐答案

来自地址是强制性的。如果您的 txtemail.Text为空,您将收到此错误。所以,你不应该允许用户在没有输入发件人地址的情况下发送邮件。
From address is mandatory. If your txtemail.Text is empty, you will get this error. So, you should not allow the user to send the mail with out entering From address.


你好,



你确定吗txtemail.Text返回用户输入的电子邮件ID?



谢谢,

Balaji
Hi,

Are you sure that txtemail.Text return the e-mail id typed by the user ?

Thanks,
Balaji


检查用户是否输入了任何数据?
Check if the user entered any data?


这篇关于参数'address'不能是空字符串。参数名称:地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆