Results 1 to 14 of 14
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP page in email

    I've been asked whether it is possible to paste an ASP page into an Outlook email. The ASP page is pulling Access database info based on the username and allowing the user to update their contact information. The ASP pages work great in Explorer but I'm not seeing a way to make them appear in an Outlook email, other than just showing the link. Any ideas? Thank you.

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Hi Searcher,

    You can paste the HTML results of an ASP page into an HTML format email. However, un-processed ASP (vBScript/JavaScript) code will not be properly processed without a web server.

    Hope this helps!

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ASP page in email

    The result of an ASP page is plain HTML, right? So you can simply use that as the message body, I would think.

    If you want the page to reload in real time, I think this is possible, too. Outlook is terrible for composing HTML mail (at least in Outlook 2000) . If you open Outlook Express, create a new message, HTML format, and turn on View>Source Edit, you can click in the <HEAD> portion of the message and paste a refresh tag. Try this one, for example:

    <meta http-equiv="refresh" content="0;URL=http://support.microsoft.com/default.aspx?scid=kb;en-us;325192">

    I think you should put a link in the body just in case the refresh is suppressed by a security setting.

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Thank you. I have a web server. I am Outlook-challenged at this point. I developed it as a web app in ASP, now they want it magically to appear in the body of an email.

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Thanks. I haven't got it work, but I'm getting warmer. When I use the ASP code as the body of the email, it shows some of the ASP code. For instance, I am pulling NAME for the database with ASP, writing it to a variable called name and writing to the page with <%=name%>. It is appearing in the mail body as <%=name%>. Also, is there a way to save an Outlook Express email and import it into Outlook. I don't have an Outlook Express mail account, just Outlook, although I am working on that too.

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Ah HA!

    I see what you want to do now (I think...)

    It sounds like you're trying to generate an email with the results of a proces from a web application. This is quite simple, but may work differently depending on your web server setup. Most Windows-based web servers support the CDONTS objects, but some servers have installed other 3rd party mail components such as ASP Form Mail

    Here's a link to a CDONTS tutorial: http://www.devasp.com/Samples/mail.asp.

    Hope this is the direction of what you're looking for...

  7. #7
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    I believe Outlook will import email from OE - but to be sure, you might want to post that question on the Outlook board and let the gurus there take a stab at it. Surely it won't be the first time it's been asked! You could also search the Lounge for that information...
    -Mark

  8. #8
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Yes, I have been trying CDONTS and been successful in all HTML coding, but once I try to put ASP coding within the CDONTS object.BODY, the %> and the " really stop it cold. Going to try putting it in a variable first I guess. Thanks.

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Yes. You're on the right track.

    As I mentioned in my first reply (above), email software will not process ASP (VBScript) code. That must be run on a web server.

    You are correct - you must send the results of the processed code in plain HTML in the body of the email. I've used this technique to create formatted email messages with information from a form submission. You will definitely want to use variables - like this:

    <%
    strName = Request.Form("FirstName") & " " & Request.Form("LastName")
    strBody = "Dear " & strName & vbCrLf
    %>
    (and so on)

  10. #10
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    If I am understanding you, you took form results from a web page and sent formatted email. I can do that. What I am being asked to do is make the original form containing the database entries appear in email and allow the user to update it and submit from email. It sounds as if, because processing ASP & VBscript is not happening in email, that is not possible. So I'm really trying to figure out how to make anything happen in the email, something like automatically opening the web page once they open the email. Flailing a little bit.

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ASP page in email

    <P ID="edit" class=small>(Edited by jscher2000 on 30-Apr-03 15:40. Forgot something kinda important.)</P>> When I use the ASP code as the body of the email, it shows some of the ASP code.

    Don't use the server-side code; use the page that appears in the browser on the client side. See <post#=248604>post 248604</post#> over on the Outlook board (in your other thread) for how to get that to appear in the mail message.

    Oh yeah: Note that most users will have JavaScript disabled in their browsers, so you'll need to do your validation on the server side after your e-mailed form posts the data to your server.

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ASP page in email

    I'm sorry, I reviewed your original post, and I think there is a problem. If you want to send one e-mail that will automatically pass any recipient's username to your server and display that individual user's personal information in the message body in real time, I think this is not possible. The Outlook security model will not permit you to seamlessly extract this information using code embedded in the message; that code will not activate, or the user will receive security warnings and be disinclined to approve the access.

    However, it should be possible to "mail merge" individualized messages that refresh to your ASP page - with a parameter - as long as you supply the parameter at the time you send the message (for example, the username, or perhaps even the e-mail address itself). In a message posted above, I gave an example of a META REFRESH tag that retrieves a Microsoft Knowledgebase article, an ASP page, with a parameter, the article number. You could, likewise, use software that generates HTML-format messages that embeds the username in a META REFRESH tag in the message. For convenience, let's call these "spam tools." <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Such tools can operate from a manually created list, or possibly even from your database.

    Hope this helps, and I apologize for missing this requirement the first time around.

  13. #13
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    I'm a little late to the party, I know, but if you have built an ASP page, that runs on a web server, why not just send an email with an inline Frame that is pointed to that webserver.

    I just tested this myself. I am attaching a .txt file that has the source for an email, which contains an inline frame. In this case, the email loads an .asp page on my companies website. That page uses ASP to display the product listing, and if you send an email to yourself, with that iframe, you are essentially putting a web page into an email. It will run like any other .asp page. A few comments, because I just tested this out.

    First, the iframe tag I put is bare bones, you can add properties that will remove scroll bars, and you can do all sorts of other tricks (no border, etc.).

    Next, initial test, OE didn't see anything in the email. Outlook 2000 saw it perfectly. I checked my settings on OE, and when I switched the security from Tight to normal Internet Zone, then the iframes showed up.

    Hopefully this helps. Another FYI, there is a .dll for a product called ASPEmail (which has a free and pay version, free is pretty useful all on its own...including the feature I am going to mention), it allows for simple emails to be sent through an SMTP server, and it can flag the email as being in HTML format.

    <img src=/S/sailing.gif border=0 alt=sailing width=25 height=25>
    Attached Files Attached Files

  14. #14
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP page in email

    Thank you all. I got to the point where the email would take the user to the web page where updates could be submitted to the db. After that, the project was given to a consultant, thankfully, since I am out of practice doing development, who is translating my ASP vbscript into vb. So I can call off the dogs of war. Thanks again.

Posting Permissions

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