Here is a screenshot containing the references below: enter image description here

BACKGROUND (the numbers correspond with the items in the screenshot)

  1. The 'Add New Item' button is pressed, which causes the 'New Item Form' Modal box to appear
  2. The New Item Form Modal Box
  3. Save New Item
  4. HTML Image hyperlink, which generates an email and populates the Mail To, Subject, and Body fields

Calculated column for HTML button (4):

="<a href=""[email protected]"&"?Subject="&joshTextString&"&Body="&Title&""" target=_top>"&"<img src=../SiteAssets/ICONS/sent.png style=height:20px;width:20px;/>"&"</a>"

  1. Send button on the automatically generated email


Once the new record is saved, I'd like an email corresponding with that new item to be automatically generated and sent. I 'd prefer not to create a WF for this, because the recipient is an external user.

Is it possible to create a script to run once (3) is pressed by the USER and the record is CREATED and SAVED, which will automatically click (4) for that new item, generating a new email, and once it's generated, automatically click (5) and send the email? I don't have a button ID, because the button is not in js.

1 Answer 1


Clicking (4) might be possible with javascript and hooking into events (closing the modal window of the new item form, for example), but clicking (5) is not. You can't control the click action in Outlook using javascript executing in a browser.

  • Appreciate the info -- what would you suggest as a good workaround? I was hoping to avoid using a 2010 workflow to send the email to an external user.
    – TheJDScott
    Jan 12, 2016 at 1:47
  • You can write a desktop application that uses CSOM to create the new list item and send the email to your SMTP server. Not a great solution - but it'd work. You'd need to create your Add New Item form in your desktop app and inform your users that they are NOT to use the browser to add these items.
    – James
    Jan 12, 2016 at 21:32
  • That's a smart fix, thanks. I am going to go with your original suggestion at stop at (4). If the button is an html button, what's the best way to hook it to the closing of the modal window? I don't expect you to solve this for me, but if you could point me in the right direction (online source) I'd be very appreciative. Thanks again for your help.
    – TheJDScott
    Jan 12, 2016 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.