Home Search Member List Faq Register Login  
UltimateEmail
Issue when sending attachments

Thread Starter: Jackxxx   Started: 12-01-2008 9:29 AM   Replies: 4
 Karamasoft Support Forums » General Discussions » UltimateEmail » Issue when sending attachments
 Printable Version    « Previous Thread   Next Thread »
  01 Dec 2008, 9:29 AM
Jackxxx is not online. Last active: 4/14/2014 6:06:44 PM Jackxxx

Top 10 Posts
Joined on 10-15-2007
Posts 133
Issue when sending attachments

When we try to send an attachment with an email we get the following error:
https://www.eph.net/UltimateEditorInclude/UserFiles/Users/Const_Track.gif
Is not a virtual path

We have tried other folders on this site and we get the same error.

Can you tell us why or is there a better way?

Here is the attchment code we are using:
' Attach files
                Dim attachmentList As String = UltimateEditor1.GetAttachmentList
                If attachmentList <> "" Then
                    ' Attach each file
                    Dim attachments() As String = attachmentList.Split(",")
                    Dim attachment As String
                    For Each attachment In attachments
                        Dim attachmentPath As String = Request.MapPath(attachment)
                        Dim ma As Attachment = New Attachment(attachmentPath)
                        mm.Attachments.Add(ma)
                    Next
                End If


  
  01 Dec 2008, 4:51 PM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Issue when sending attachments
In order for a link to be virtual, it must be defined as a virtual directory on your IIS. If that's the case, when you call Request.MapPath you can get the physical path to that virtual link. You cannot use a link like "http://www.eph.net/UltimateEditorInclude/UserFiles/Users/Const_Track.gif" because it is not a virtual path but just a absolute public url. Instead, your link must be something like "/UltimateEditorInclude/UserFiles/Users/Const_Track.gif" so that it can map the virtual path to a physical path.
  
  01 Dec 2008, 5:10 PM
Jackxxx is not online. Last active: 4/14/2014 6:06:44 PM Jackxxx

Top 10 Posts
Joined on 10-15-2007
Posts 133
Re: Issue when sending attachments
We had an issue like this a while ago and you sent this sample code for us to use. Is it the code that is causing this to happen? If yes, what changes do you recommend? Is there a sample that works that we can look at?

Thank you,

' Attach files
                Dim attachmentList As String = UltimateEditor1.GetAttachmentList
                If attachmentList <> "" Then
                    ' Attach each file
                    Dim attachments() As String = attachmentList.Split(",")
                    Dim attachment As String
                    For Each attachment In attachments
                        Dim attachmentPath As String = Request.MapPath(attachment)
                        Dim ma As Attachment = New Attachment(attachmentPath)
                        mm.Attachments.Add(ma)
                    Next
                End If

  
  01 Dec 2008, 5:22 PM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Issue when sending attachments
There is no problem with the code, and you can test it on your development machine by debugging each line. If you're setting the ConvertSelectedPathToAbsolute property of UltimateEditor to true, may be it's converting your path to absolute and you can't run MapPath on it anymore. Again, please debug your code and use a virtual path instead of an absolute path. Then MapPath will work fine, and you will be able to attach the file properly.
  
  01 Dec 2008, 6:01 PM
Jackxxx is not online. Last active: 4/14/2014 6:06:44 PM Jackxxx

Top 10 Posts
Joined on 10-15-2007
Posts 133
Re: Issue when sending attachments
You are correct. We had the ConvertSelectedPathToAbsolute=true

Thank you so much,

  
 Page 1 of 1 (5 items)
Karamasoft Support Forums » General Discussions » UltimateEmail » Issue when sending attachments

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.