asp as attachment

Results 1 to 3 of 3

Thread: asp as attachment

  1. #1
    aaa Guest

    Default asp as attachment

    Hi,<BR> Iam displaying ASP file with some data driven from DATABASE, Now I want to send that page as an E-MAIL. I Want to give an option to user to enter e-mail address and click on send button to send that page as attachment. i dont care if code is server 0r client side.<BR><BR>Note: i dont want to use Send page by email option in File Menu of IE

  2. #2
    Join Date
    Dec 1969

    Default RE: asp as attachment

    You can send the url of the page as email by retrieving the exact path of the file or you can try ASPUpload component which can help you to send the file as attachment

  3. #3
    Join Date
    Dec 1969

    Default RE: asp as attachment

    if you have the IIS 4.0 resource kit. It comes with a program called asp2htm. You can use this to feed your web page your variables through a url. run the page, write the file out to your server. then create an email, attach the email, and then send it off. there may be a more efficient way to do this, but this was quick and easy and worked for me.<BR><BR>looks like this in VB.<BR><BR>Dim fs As Scripting.FileSystemObject<BR>Dim sBuffer As String<BR>Dim tStream As TextStream<BR>Dim newmail As Object<BR>Dim http As Object<BR><BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>Set newmail = CreateObject("Cdonts.newmail")<BR>Set http = CreateObject("IISSample.Asp2Htm")<BR><BR>http.URL ("http://server/blah.asp?id=" & id & " ")<BR><BR>If http.GetData() Then<BR> boo = http.WriteToFile("c:location of file\" & id & ".htm")<BR>End If<BR> <BR>&#039 creating text stream so the asp page can be written to a file and then attached to an email<BR>Set tStream = fs.OpenTextFile("c:location of file\" & id & ".htm")<BR><BR>While Not tStream.AtEndOfStream<BR> sBuffer = sBuffer & tStream.ReadLine() & vbCrLf<BR>Wend<BR><BR>&#039get email address<BR>strEmailAddress = ""<BR><BR>&#039 setting email parameters<BR>newmail.From = ""<BR>newmail.To = strEmailAddress<BR>&#039use this if you want to make the file in the email. (html email, not an attachment)<BR>&#039newmail.Body = sBuffer<BR>newmail.BodyFormat = 0<BR>newmail.MailFormat = 0<BR>newmail.Subject = "your email"<BR>&#039attach file (first is filename, then you give the attachment a name, just look up cdo documentation)<BR>newmail.AttachFile "c:location of file\" & id & ".htm", id & ".htm"<BR>newmail.Send<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts