Add automatically a file to send by e mail
-
this code launches the email program on the computer
UI.openURL("mailto:???@???")
Is there a way to add automatically a file?
i didn't find anything here http://code.google.com/intl/fr/apis/sketchup/docs/ourdoc/ui.html#openURL
-
You can't add 'arguments' to a UI.openURL() - it's a 'path' only tool.
BUT you can write a cmd/bat file with the needed data and then open that [it 'executes'] and that can pass/use arguments written into it thus...START mailto;"someone@somewhere.com?subject=The%%20Title&cc=%%20&bcc=%%20&body=Hello%%20testing%%20123
See here for more details http://www.robvanderwoude.com/email.php or http://www.paulsadowski.com/wsh/cmdmail.htm
There are ways to escape the used special characters if you want...
Just compile the message File.write to a temp file called say 'C:/Temp/emailer.cmd' then
UI.openURL('file:///C:/Temp/emailer.cmd')
to run it.
You can even make it erase it self as it ends... -
@tig said:
You can't add 'arguments' to a UI.openURL() - it's a 'path' only tool.
BUT you can write a cmd/bat file with the needed data and then open that [it 'executes'] and that can pass/use arguments written into it thus...START mailto;"someone@somewhere.com?subject=The%%20Title&cc=%%20&bcc=%%20&body=Hello%%20testing%%20123
See here for more details http://www.robvanderwoude.com/email.php or http://www.paulsadowski.com/wsh/cmdmail.htm
There are ways to escape the used special characters if you want...
Just compile the message File.write to a temp file called say 'C:/Temp/emailer.cmd' then
UI.openURL('file:///C:/Temp/emailer.cmd')
to run it.
You can even make it erase it self as it ends...i am not familiar with batch programs, but i shall try to understand the way to do it; thank you!
Advertisement