本文介绍了嗨,任何机构,请帮助我有关以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi iam遇到以下错误.
无效的附件,例如"C:\\ readme.txt".

我的应用程序正在使用IE.
但不适用于Mozilla.
我该如何纠正此错误.

代码:


hi iam getting the following error.
invalid attahment like"C:\\readme.txt".

my application is working with IE.
but it does n''t work with Mozilla.
how can i rectify this error.

code:


MailMessage msgMail = new MailMessage();
        msgMail.To = TextBox3.Text;
        msgMail.From = "[email protected]";
        msgMail.Subject = "Attachment Test";

        msgMail.BodyFormat = MailFormat.Text;
        msgMail.Body = "Name:" + txtName.Text + "\n" + "Designation:" +                                        DropDownList1.Value + "\n" + " Phone No:" + TextBox2.Text;
        String strPath = Path.GetFullPath(MyFile.PostedFile.FileName);
        msgMail.Attachments.Add(new MailAttachment(strPath));
        SmtpMail.Send(msgMail);
        Response.Write("Email was queued to disk");

推荐答案




这篇关于嗨,任何机构,请帮助我有关以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 11:01