NetTalk Central

Author Topic: How to call default email client with attachment?  (Read 4028 times)

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
How to call default email client with attachment?
« on: January 05, 2012, 11:03:08 AM »
I'm pretty sure this can be done.  In fact, I think I did it a few years ago with a NetTalk web application but I cannot remember how I did it?

I want to have a button on a form

Clicking the button will call the default email client - Outlook, Outlook Express, whatever.

When the email client opens I want to automatically attach a file of my choice.

I can call the default mail client now but I have not figured out the attachment part of it.

Thanks,

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: How to call default email client with attachment?
« Reply #1 on: January 05, 2012, 08:24:16 PM »
If you google
HTML mail to attachment
You'll get some good info.

The short answer is that you can pass parameters with the mailto URL, but ultimately it is he mail client program that interprets those parameters and operates on them. So mileage may vary from one email client to the next.

Attachments (if they do work) are going to be limited to what the mail program can see - ie files on the LAN, not the wan.

Cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to call default email client with attachment?
« Reply #2 on: January 06, 2012, 04:27:05 AM »
Yeah, I Google'd the heck out of it.  I guess I should have asked, is, how to add the "attachment" parameter within the context of a NetTalk button?

Thanks,

Don 
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: How to call default email client with attachment?
« Reply #3 on: January 06, 2012, 06:39:56 AM »
just add the parameters to the URL for the button. I haven't tried this myself, but it seems fairly straight-forward.
Let me know if you don't come right.

cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to call default email client with attachment?
« Reply #4 on: January 06, 2012, 07:05:06 PM »
I have tried that but I think I'm getting the syntax wrong.  However, I got to thinking about what you said:

"Attachments (if they do work) are going to be limited to what the mail program can see - ie files on the LAN, not the wan."

That is an important point.  It may be more trouble than it's worth to provide this functionality. 

I liked the idea of the user using his/her own email program with their own contact list to send emails. 

Thanks,

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: How to call default email client with attachment?
« Reply #5 on: January 07, 2012, 05:14:21 AM »
How do you get the email address into the default email client?

I am NOT doing this froma  button but on the On Click properties of a field on a browse. Calls the email client up but does not put the address in.

Also on the same vein, tried same with URLbut this does nothing. Is this broken?

IOW call the field a type email or URL but URL does nothing.

Thanks

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: How to call default email client with attachment?
« Reply #6 on: January 09, 2012, 12:53:38 AM »
It doesn't look broken as far as I can tell.
Try the Hyperlinks example, email column. that's set to "field contains an email address".

If you want more control over the URL (or, for example, you want to show the name, and link to the email address) then tick the option off, and insert the URL directly; for example

'mailto: someone@nowhere.com?subject=hello'

Cheers
Bruce