Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) [Solved] @ASynchShell file insert? (Read 3366 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
[Solved] @ASynchShell file insert?
Nov 25th, 2008 at 4:16pm
Print Post Print Post  
I can open Outlook, insert an email address and fill in the subject area using:  

@ASynchShell("mailto: emailaddress?subject=Have a Happy Turkey Day everybody?")

Is it possible to also insert a file at the same time?

And while we’re at it, is it also possible to fill in the body of the message with the file contents?

I was able to insert a file using CreateAProcess but not the subject or address at the same time.

I would prefer to use @ASynchShell.

Thanks
« Last Edit: Nov 28th, 2008 at 1:54am by Hammer »  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @ASynchShell file insert?
Reply #1 - Nov 25th, 2008 at 5:58pm
Print Post Print Post  
There are some old examples on the forum with more details.  Search for Outlook.

But here are some quick lines from some old notes I had handy:

Quote:
vEmail = "myname@myplace.com"
vRe = "This is a test of the Subject line"
vPath = @CHR(34) + "C:\Program Files\Microsoft Office\Office\OUTLOOK.EXE" + @CHR(34)
n = @Shell(vPath + " /c ipm.note /m mailto:" + vEmail + "?Subject=" + vRe)

Outlook command line switches are here: http://www.outlook-tips.net/howto/commandlines.htm but do not seem to include switches for body.  And just a reminder, Outlook is not the same as Outlook Express which has a different syntax.
« Last Edit: Nov 25th, 2008 at 7:57pm by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ASynchShell file insert?
Reply #2 - Nov 25th, 2008 at 6:48pm
Print Post Print Post  
The webpage in the link includes a /a switch that appears to allow a file attachment. Also, it appears that &body might get you the message body. Something like:
@ASynchShell("mailto: emailaddress?subject=Have a Happy Turkey Day everybody&body=bodytext")


BTW, Would the built-in @SendMail command work for you?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @ASynchShell file insert?
Reply #3 - Nov 25th, 2008 at 7:08pm
Print Post Print Post  
Thanks for the responses Bob & Erica.

I was secretly hoping that you might come up with a word just like “subject=” that I hadn’t tried yet, like attachment=, file=, etc. I knew I couldn’t get that lucky!

I’ll give your suggestions a try.

Thank you.
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @ASynchShell file insert?
Reply #4 - Nov 25th, 2008 at 7:27pm
Print Post Print Post  
I guess that I should have looked at the current web page.  That reference, as I noted, was from some OLD notes.  I had a printout of that page and /a was not included.  I don't know if /a is an addition or if my original was in error.

Where do you see the reference to "&body=" ?  I know that is good for Thunderbird but can't find that for Outlook.

In any case, thanks for the update Erika.  I have made a new printout that includes the "/a".
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ASynchShell file insert?
Reply #5 - Nov 25th, 2008 at 7:30pm
Print Post Print Post  
Bob_Hansen wrote on Nov 25th, 2008 at 7:27pm:
Where do you see the reference to "&body=" ?  I know that is good for Thunderbird but can't find that for Outlook.


No one place. I saw it go by in several places as I looked around. I don't want to install Outlook, so I can't really test this, unfortunately...
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @ASynchShell file insert?
Reply #6 - Nov 25th, 2008 at 8:20pm
Print Post Print Post  
&body= does place whatever follows the = sign into the message portion of the email. Now, what’s the trick to getting it to enter text or jpg content from a variable? In other words I can't get &body= to place a files contents into the message area, only whatever is typed after the = sign shows up.

The a/ switch only seems to work when using CreateAProcess. I didn't have any luck when trying it with @shell.
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ASynchShell file insert?
Reply #7 - Nov 25th, 2008 at 8:38pm
Print Post Print Post  
tcgeo wrote on Nov 25th, 2008 at 8:20pm:
&body= does place whatever follows the = sign into the message portion of the email. Now, what’s the trick to getting it to enter text or jpg content from a variable? In other words I can't get &body= to place a files contents into the message area, only whatever is typed after the = sign shows up.

The a/ switch only seems to work when using CreateAProcess. I didn't have any luck when trying it with @shell.


I know it won't just stuff a jpg in there. Binary content would have to be an attachment. For text, try reading the file contents into a variable using @Insert, then passing in the variable.

var vMsg as String

    vMsg = @Insert("myfile.txt")
    ...whatever... "&body=" + vMsg
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @ASynchShell file insert?
Reply #8 - Nov 25th, 2008 at 9:46pm
Print Post Print Post  
Thanks for the suggestion.

I can't get it to accept the + vMsg part. I'll keep pounding on it.

Thanks again.
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ASynchShell file insert?
Reply #9 - Nov 25th, 2008 at 10:28pm
Print Post Print Post  
tcgeo wrote on Nov 25th, 2008 at 9:46pm:
Thanks for the suggestion.

I can't get it to accept the + vMsg part. I'll keep pounding on it.

Thanks again.


You have to get it in the right place. You're assembling the text as if you'd typed it. Of course, if the text has carriage returns or is very long, it will break the command line.

Again, is there a reason why you are not using @SendMail? It does all this stuff.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @ASynchShell file insert?
Reply #10 - Nov 25th, 2008 at 10:35pm
Print Post Print Post  
Only that it looks pretty daunting, but I'm going to work on it.

Thanks.
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ASynchShell file insert?
Reply #11 - Nov 25th, 2008 at 11:58pm
Print Post Print Post  
tcgeo wrote on Nov 25th, 2008 at 10:35pm:
Only that it looks pretty daunting, but I'm going to work on it.

Thanks.


Believe me that it's a boatload easier than automating Outlook. Get in touch with Support tomorrow if you need more examples.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @ASynchShell file insert?
Reply #12 - Nov 26th, 2008 at 1:38pm
Print Post Print Post  
Ok Erica, @SendMail is not that daunting, it works well!

Thanks for bringing it to my attention.

Have a great holiday!
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ASynchShell file insert?
Reply #13 - Nov 26th, 2008 at 1:45pm
Print Post Print Post  
tcgeo wrote on Nov 26th, 2008 at 1:38pm:
Ok Erica, @SendMail is not that daunting, it works well!

Thanks for bringing it to my attention.

Have a great holiday!


You're welcome. I'm glad you are undaunted!  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @ASynchShell file insert?
Reply #14 - Nov 26th, 2008 at 3:03pm
Print Post Print Post  
Maybe a little more help on this?

When I enter a complete path into the @SendMail code to attach a jpg, the email works great. If I use a variable and place it in the same location, the email never gets received. I don’t know if it gets sent.

For example, this works:

……."writer@NotReallyAServer.com, "", "Hey guys, how are you?", "", "", "C:\my.jpg")

This does not work:

……."writer@NotReallyAServer.com, "", "Hey guys, how are you?", "", "", vPath)

While playing around with it, I added this:  ,""  to the code so that it looks like this:

……."writer@NotReallyAServer.com, "", "Hey guys, how are you?", "", "", "", vPath)

With this I receive two emails, one with the attachment and one without. The one with the attachment has the attachment scaled down in size to about 20% of the original and cannot be opened.

Any ideas on how to get it to accept the variable?

Thanks.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print