VB Script mailto with body

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

VB Script mailto with body

Post by Phil Pendlebury » Sun May 28, 2023 10:23 am

Greetings,

I found this:

Code: Select all

VBSTART
Sub NewEmail(recipient,subject)
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "mailto:" & recipient & "?subject=" & subject
Set WshShell = Nothing
End Sub
VBEND
VBRun>NewEmail,[email protected],Testing
Tried a number of things but not working, I simple want to add some text to the email body.

Is there any way to add a body command to the above script?

What I need to do:
  • Open the user's default email application
    Add a list in the body that has been already gathered by my script.(So this would be variable, like %datalist%)
    The end result would be that the email is already prepared for them and they can then send it.
(I was previously using the built in mail send process but the emails have started getting marked as spam, so I just want to format the email ready for the user to send manually).

Also I find that if the Subject is more than one word, the script above only uses one word. For example: "Missing Aircraft", becomes "Missing". I tried putting it in a variable and inserting in quotes, neither seems to work.

Any assistance appreciated.

P. :-)
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: VB Script mailto with body

Post by Phil Pendlebury » Sun May 28, 2023 11:18 am

nb. I would love to just switch to using a gmail account to send the email using sendmail but it seems to no longer work despite following all guides here.
Phil Pendlebury - Linktree

User avatar
Marcus Tettmar
Site Admin
Posts: 7394
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: VB Script mailto with body

Post by Marcus Tettmar » Sun May 28, 2023 12:09 pm

I think this depends on the email client. You can add &body= parameter but I am not sure how many mail clients support it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: VB Script mailto with body

Post by Phil Pendlebury » Sun May 28, 2023 5:40 pm

Hmm any idea what the format would be? I tried adding a body section and the script fails.
Phil Pendlebury - Linktree

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts