在godaddy中使用c#发送电子邮件 [英] sending email using c# in godaddy

查看:144
本文介绍了在godaddy中使用c#发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是faizel,我在godaddy.right托管了一个网站,现在我正在尝试使用c#发送带附件的邮件。但是我无法将任何文件上传到该文件夹​​。我的代码是

Hi,
I am faizel and i hosted a website in godaddy.right now i am trying to send mail with an attachment using c#.But i am unable to upload any file to the folder.my code is

MailAddress mailfrom = new MailAddress("info@breakview.com");
        MailAddress mailto = new MailAddress("info@breakview.com");
        MailMessage newmsg = new MailMessage(mailfrom, mailto);

        newmsg.Subject = "Resume Posted";
        newmsg.Body = "See Attached Resume";
        if (FileUpload1.HasFile)
        {
            
                string ImgPath1 = Server.MapPath("~/resume/" + Guid.NewGuid() + FileUpload1.FileName);
                FileUpload1.SaveAs(ImgPath1);

                Attachment att = new Attachment(ImgPath1);
                newmsg.Attachments.Add(att);
           
        }
        SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);
        smtp.UseDefaultCredentials = false;
        smtp.Credentials = new NetworkCredential("info@breakview.com", "######");
       
        smtp.Send(newmsg);





i我遇到错误



i am getting an error at line

FileUpload1.SaveAs(ImgPath1);





错误是访问路径'D:\Hosting\12049298 \ html\breakview \resume\b6609e03-9e2f-411b-b8e8-49556740d989debug.log'被拒绝。



我不知道该怎么办请帮帮我。



Error is Access to the path 'D:\Hosting\12049298\html\breakview\resume\b6609e03-9e2f-411b-b8e8-49556740d989debug.log' is denied.

I dont know what to do please help me.

推荐答案

错误很明确:你没有写(上传)权限。

联系GoDaddy并要求上传该文件夹的权限:)



祝你好运
The error is clear: you don't have write (upload) permissions.
Contact GoDaddy and ask for upload permissions for that folder :)

Good luck


您好faizel,



您需要请求您的提供商为您授予完全许可。但似乎godaddy不支持完全信任许可。为了确保它,请联系他们。祝你好运。
Hi faizel,

You need to ask your provider to grant full permission for you. But it seems that godaddy doesnt support full trust permission. To make sure about it, please just contact them. Good luck.


改变自己的数据库权限。你可以这么做。只是检查一下..
Change database permissions your self. you can do it dude..just check it..


这篇关于在godaddy中使用c#发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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