Link to home
Start Free TrialLog in
Avatar of JB4375
JB4375Flag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of EMB01
EMB01
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JB4375

ASKER

VB. Thanks for the link. I'll check it out.

JB
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JB4375

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(attachment)

    (Standard here....   Mail To, From, Mailbody etc. )

End Sub