嗨,任何机构,请帮助我有关以下错误 [英] hi any body please help me about the following error

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

问题描述

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 = "abc@gmail.com";
        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");

推荐答案

带有多个ASP.NET电子邮件附件

希望以上信息对您有所帮助.如果您还有其他顾虑,请告诉我.
ASP.NET email with multiple attachments

I hope the above information will be helpful. If you have more concerns, please let me know.


您正尝试从客户端计算机上自行附加文件...尝试执行以下操作

1.将文件上传到应用程序具有读取权限的服务器位置.
2.使用此文件位置进行附件.
You are trying to attach the file from the client machine it self...try to do the following

1. upload the file to a server location where the application has read permission.
2. use this file location for attachment.




首先将文件保存在所需位置.
比从该位置使用sevrer.mappath获取文件
Hi,

first of all save your file at desire location.
than get a file using sevrer.mappath from that location


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

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