Jump to content

[Resolved] Mailto but launching via non-default email client?


Recommended Posts

This launches the default email client in the usual way and puts the email address in the To box:

ShellExecute('mailto:Email@somewhere.com')oÝ÷ ح­rb(ºWpzë¶h¶¬jgºÛâi§b}÷«z{^¨¥rXØ:ëe¢ÆÞ²Â-®'½ªâ¢ë/j¸¶*'²í+!z·ºØ­v¬mÂäjëh×6$OE = @ProgramFilesDir & "\Outlook Express\msimn.exe"

ShellExecute($OE, 'mailto:' & $mail2Address) ...
Outlook Express _is_ launched but more as if this were an ordinary program launcher script. No new compose window opens up with the email address, ready to go.

Thanks! :D

Edited by Diana (Cda)
Link to comment
Share on other sites

Try msimn /mailurl:mailto:"someone@somewhere.net?subject=Test&body=Hi

That should open up Outlook Express and pre-populate the email address, subject, etc.

This launches the default email client in the usual way and puts the email address in the To box:

ShellExecute('mailto:Email@somewhere.com')oÝ÷ ح­rb(ºWpzë¶h¶¬jgºÛâi§b}÷«z{^¨¥rXØ:ëe¢ÆÞ²Â-®'½ªâ¢ë/j¸¶*'²í+!z·ºØ­v¬mÂäjëh×6$OE = @ProgramFilesDir & "\Outlook Express\msimn.exe"

ShellExecute($OE, 'mailto:' & $mail2Address) ...
Outlook Express _is_ launched but more as if this were an ordinary program launcher script. No new compose window opens up with the email address, ready to go.

Thanks! :D

Link to comment
Share on other sites

Try msimn /mailurl:mailto:"someone@somewhere.net?subject=Test&body=Hi

That should open up Outlook Express and pre-populate the email address, subject, etc.

Hi and thanks!

I ran into some trouble. There seems to be missing punctuation, etc. I tried everything I could think of but I'm obviously missing something. Here are a couple of the failed attempts:

;ShellExecute(msimn /mailurl:"mailto:someone@somewhere.net?subject=Test&body=Hi")

ShellExecute("msimn /mailurl:mailto:someone@somewhere.net?subject=Test&body=Hi")
I tried putting the punctuation in the most obvious spots and tried combinations of quotes and apostrophes. Get errors each time. What am I doing wrong, pls?

Thanks! :D

Link to comment
Share on other sites

Hi and thanks!

I ran into some trouble. There seems to be missing punctuation, etc. I tried everything I could think of but I'm obviously missing something. Here are a couple of the failed attempts:

;ShellExecute(msimn /mailurl:"mailto:someone@somewhere.net?subject=Test&body=Hi")

ShellExecute("msimn /mailurl:mailto:someone@somewhere.net?subject=Test&body=Hi")
I tried putting the punctuation in the most obvious spots and tried combinations of quotes and apostrophes. Get errors each time. What am I doing wrong, pls?

Thanks! :D

Hi,

Run("""c:\programme\outlook express\msimn""" & " /mailurl:mailto:""someone@somewhere.net?subject=Test&body=Hi") is working on german system. You may have problems on english systems, because of the blank in program files.

Perhaps you should define a string beforehand, like:

$cmd = @ProgramFilesDir & outlook express\msimn""" & " /mailurl:mailto:""someone@somewhere.net?subject=Test&body=Hi"

Run (""" & $cmd)

;-))

Stefan

Link to comment
Share on other sites

Try this.

$outlook = @ProgramFilesDir & "\Outlook Express\msimn.exe"

ShellExecute($outlook, '/mailurl:mailto:"someone@somewhere.net?subject=Test&body=Hi')

Hi and thanks!

I ran into some trouble. There seems to be missing punctuation, etc. I tried everything I could think of but I'm obviously missing something. Here are a couple of the failed attempts:

;ShellExecute(msimn /mailurl:"mailto:someone@somewhere.net?subject=Test&body=Hi")

ShellExecute("msimn /mailurl:mailto:someone@somewhere.net?subject=Test&body=Hi")
I tried putting the punctuation in the most obvious spots and tried combinations of quotes and apostrophes. Get errors each time. What am I doing wrong, pls?

Thanks! :D

Link to comment
Share on other sites

Thanks everyone. Seems to have done the job. I've been using this code for several days now with no problems so far. Here's the final code, as it stands now:

;=====================================================================
$OE                  = @ProgramFilesDir & "\Outlook Express\msimn.exe"
$OEtitle             = "Outlook Express"
$WindowsTitle_Hidden = " (... title) ... "     ; OE's compose window doesn't have a title but put this here anyway till I can figure out how to get WinSetState to work
$mail2Recipient      = " ... (email address) ... "
$Subject             = ""
$BodyOfMsg           = ""
$Mail2Code           = '/mailurl:mailto:"'     ; don't forget the final apostrophe, ', at the end of the line of coding below.
$SendCode            = "{TAB 3}"
;=====================================================================


; example:
; -------
; ShellExecute($outlook, '/mailurl:mailto:"someone@somewhere.net?subject=Test&body=Hi')
;ShellExecute($oe, $Mail2Code & $mail2Recipient & "&subject=" & $Subject & "&body=" & $BodyOfMsg & "'")
;ShellExecute($oe, '/mailurl:mailto:"' & $mail2Recipient & "?subject=" & $Subject & "%20%20&body=" & $BodyOfMsg & "")
ShellExecute($oe, $Mail2Code & $mail2Recipient & "?subject=" & $Subject & "%20%20&body=" & $BodyOfMsg & "")
;WinWait($OEtitle)
;WinSetState ($OEtitle, "", @SW_MAXIMIZE)
Sleep(1000)
Send($SendCode)
As always, I like to have as generic a script possible for future re-use. Since I discovered variables, I love them and use them a lot. So in future, I just copy this script and make minor changes and good to go.

I use 3 email clients, each for specific tasks, so having a way to call a specific one is great and this script seems to do this reliably.

Thanks. :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...