Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 am getting an error at line
FileUpload1.SaveAs(ImgPath1);


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.
Posted
Updated 3-Dec-13 18:48pm
v4

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

Good luck
 
Share this answer
 
Comments
faizel s 2-Dec-13 12:32pm    
Thanks for trying to help me.Are you sure this works
Joezer BH 4-Dec-13 1:48am    
It will work once you have the permissions to that specific path.
Of course they don't have to give you permissions,
it depends on the path you are trying to use and the account you have.

Best to contact the GoDaddy service desk and ask them for upload folder path and the technicalities involved in your account management.

Cheers
faizel s 4-Dec-13 13:41pm    
i thank you from bottom of my heart. May god bless you.
Joezer BH 8-Dec-13 0:51am    
Amen :)
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.
 
Share this answer
 
Change database permissions your self. you can do it dude..just check it..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900