Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to add Attachment to Mailto

    My mailto script works fine - but how can I add an attachment to the email?

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    i'm assuming that when you say "Mailto script" what you mean, is a form that has it's action set to "mailto:someguy@someplace.com".

    if that's the case, then see the following link for a nice little tutorial on how to do this: http://www.htmlgoodies.com/attachp2.html

    if that's not what you're talking about, then you're going to have to provide some actual details.

    hope that helps

    ps: as with your other post, because i don't think that this is going to have anything to do with javascript, i'm moving it to the HTML & CSS forum
    Last edited by joh6nn; 11-10-2002 at 02:19 PM.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New Coder
    Join Date
    Oct 2002
    Location
    UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the link to HTML Goodies - they have some interesting bits - but I can't figure out the mailto.

    This is the line of code that I want to send a file with -

    document.writeln('<a href="mailto:?subject=Pictures from PhotoAlbum&cc= &body=This is the body text&attachment='+filetosend+'">Email</a><br>');

    It works fine and creates the email - until I try and add the attachment.

    This is also where I want to break up the body text with carriage returns.

    Thanks in advance!

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    ok, the only way i know of, to send a file, without using a server side script, is the way listed in the HTML Goodies page.

    as far as getting line breaks into the body, i'll post the answer to that, in the other thread.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    New Coder
    Join Date
    Oct 2002
    Location
    UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Help - I can't get this to work - it brings up the email program (Outlook) and puts in the subject and body text - but no attachment!

    document.writeln('<a href="mailto:?subject=Pictures from PhotoAlbum&cc= &body=This is the body text&attachment='+mFiletosend+'">Email</a><br>');

    mFiletosend is the path and filename - it looks OK in the status bar and it is the same as I use to display the image on screen.

    Does Outlook need more of an address to find it?

    Any ideas?

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    HTML Goodies:

    "I was successful with text-based documents like HTML. Word files and images never did come through correctly. They seemed to attach and send just fine, but would be destroyed when they arrived in my e-mail box."
    Sorry, but I've never seen this question answered. I'd just use a cgi/asp/php script without all the annoying prompts. Much quicker and efficient, too.

    Try finding an OE forum at Microsoft or Tek-Tips.
    Last edited by zoobie; 11-12-2002 at 11:03 PM.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, trying to format the body of a message using "mailto" is problematic, because Outlook Express is buggy using "mailto" in more than one way.

    The only way (as joh6nn said) to reliably do either one (attachment or formatting) is to use a server-side language.

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    LinkBacks (?)

    1. 05-23-2014, 10:18 PM

    Posting Permissions

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