• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Another Mail Script Fails on El Capitan – Send Styled Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another Mail Script Fails on El Capitan – Send Styled Text


  • Subject: Re: Another Mail Script Fails on El Capitan – Send Styled Text
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 27 Nov 2015 09:10:15 +0100


Le 2015/11/27 à 03:09, Christopher Stone <email@hidden> a écrit :

Hey Folks,

I just noticed this isn't working on 10.11.1.

-------------------------------------------------------------------------------------------
# Auth: Mark Munro (Macscripter)
# dCre: 2013/08/04 01:09
# dMod: 2015/11/26 19:48
# Appl: Mail
# Task: Make new HTML email!
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Mail, @New, @Message, @HTML, @Content
-------------------------------------------------------------------------------------------

set textBody to "<HTML>
<BODY bgcolor=\"#99CCFF\">
   <H1>Hi There</H1>
   <p>This is very minimal <u>\"hello world\"</u> HTML document.</p> 
</BODY>
</HTML>"

set textSubject to "HTML Test"
set toAddress to "email@hidden"
set toName to "Me"

mailMessageCreate(toName, toAddress, textSubject, textBody)

on mailMessageCreate(toName, toAddress, textSubject, textBody)
  tell application "Mail"
    activate
    set refMessage to make new outgoing message with properties {subject:textSubject, visible:true} -- visible MUST be false to work
    tell refMessage
      set html content to textBody -- must set the _HTML CONTENT_ rather than the _CONTENT_
      make new to recipient at end of to recipients with properties {name:toName, address:toAddress}
      send
    end tell
  end tell
end mailMessageCreate

-------------------------------------------------------------------------------------------

Can someone confirm?


Here it creates a blank message.


Yvan KOENIG running El Capitan 10.11.1 in French (VALLAURIS, France) vendredi 27 novembre 2015 09:10:10



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Another Mail Script Fails on El Capitan – Send Styled Text (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Another Mail Script Fails on El Capitan – Send Styled Text
  • Next by Date: Re: How to get the number of items in a selected Folder ?
  • Previous by thread: Re: Another Mail Script Fails on El Capitan – Send Styled Text
  • Next by thread: Expected end of line, etc. but found identifier
  • Index(es):
    • Date
    • Thread