how to send radupload attachments through smtp on IIS

Thread is closed for posting
4 posts, 1 answers
  1. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 04 Nov 2011 Link to this post

    hello,

    i am working on email functionality and recently i  am using rad uploader to upload files and send to mails through smtp connection.the code that i wrote working fine in localsystem,but when we deploy it on IIS(V 5.1 or 7) it is getting error,path cannot be found /access  to path is  denied ,i am sending code block  please reply soon ,Thanks.

    System.Net.Mail.Attachment attachment;
               foreach (UploadedFile file in RadUpload1.UploadedFiles)
               {
                   try
                   {
                       string strFileName = null;
                        strFileName = System.IO.Path.GetFullPath(file.FileName);
                       attachment = new System.Net.Mail.Attachment(strFileName);
                       Message.Attachments.Add(attachment);
                      }
             catch
               {
               }
        }

     

  2. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 07 Nov 2011 Link to this post

    hello ,
    sending attachments through rad uploader is solved by adding file.InputStream in attachment

    attachment =

     

    new System.Net.Mail.Attachment(file.InputStream, strFileName);

     

    but we are getting a url of path in mail to which we are sending it while downloading from their inbox . is there any way to hide the path and display only attachment name ,please respond thanks. 
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 07 Nov 2011 Link to this post

    Hello Saimadhukar,

    Change you code to this:

    attachment = new System.Net.Mail.Attachment(file.InputStream, file.GetName());

    I hope that helps.
  5. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 08 Nov 2011 Link to this post

    Hello Kevin,

    thank u that works fine..
Back to Top