开发者

Exception Error in the Code

开发者 https://www.devze.com 2022-12-31 13:00 出处:网络
A frequently error is coming in the Code and error message of that error is At least one recipient is required, but none were found

A frequently error is coming in the Code and error message of that error is

At least one recipient is required, but none were found

and Stack trace of that error is given below .

at System.We开发者_如何转开发b.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) 
at System.Web.Mail.SmtpMail.Send(MailMessage message) 
at MFActivityPlanning.clsCommons.SendEmail(String sToMailAddr, String sSubject, String sMessage, MailFormat format, String sFromMailAddr)

pls help me, how can fix it?


Either you are passing null or an empty string to the SendMail method for the parameter sToMailAddr. Alternatively, you may not be adding the recipient email address to the MailMessage object in the SendMail method.


First of all: A little code would help.

The Exception says that you need to add a recipient for your mail, so obviously you're either not passing a valid mail address to your SendEmail method in the sToMailAddr parameter or the mail address is not being assigned to the respective properties before you try to send the mail.

Without code, there's nothing more I can say.


It sounds as if there isn't a value in sToMailAddr, as that would be the recipient.

0

精彩评论

暂无评论...
验证码 换一张
取 消