JB4375
asked on
Adding an Attachment from an ASP.Net page with VB.Net
I have a page that allows a user to submit a ticket to our Help Desk ticketing system Remedy.
For some issues and requests the amount of information required is rather complex. The solution has been to generate a formatted RTF file that contains all of the information submitted.
In testing I've been able to create the file and save it to my hard drive, but for this particular page it wouldn't be acceptable to have the user click an attach button and then browse to the file.
I really want to be able to save it in the memory space of the page itself, specify the name of the attachment and have it sent on submit.
Could someone direct me to an example?
Thanks in advance,
JB
For some issues and requests the amount of information required is rather complex. The solution has been to generate a formatted RTF file that contains all of the information submitted.
In testing I've been able to create the file and save it to my hard drive, but for this particular page it wouldn't be acceptable to have the user click an attach button and then browse to the file.
I really want to be able to save it in the memory space of the page itself, specify the name of the attachment and have it sent on submit.
Could someone direct me to an example?
Thanks in advance,
JB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Guys,
I was able to do it directly with the following:
Imports System.Net
Imports System.Net.Mail
Public Sub Send_Email()
Dim Mail As New MailMessage()
Dim mailBody As String
Dim attachment As System.Net.Mail.Attachment
Attachment = New System.Net.Mail.Attachment ("filename ")
Mail.Attachments.Add(attac hment)
(Standard here.... Mail To, From, Mailbody etc. )
End Sub
I was able to do it directly with the following:
Imports System.Net
Imports System.Net.Mail
Public Sub Send_Email()
Dim Mail As New MailMessage()
Dim mailBody As String
Dim attachment As System.Net.Mail.Attachment
Attachment = New System.Net.Mail.Attachment
Mail.Attachments.Add(attac
(Standard here.... Mail To, From, Mailbody etc. )
End Sub
ASKER
JB