Can the default font size for "Email this Page" text be changed in Mountain Lion?

In Mountain Lion, Safari has a new method of "Email this Page" which opens up a new mail message where the web content can be shown as a page, pdf, or a link.

If one chooses "Link", the font type and size for the link text is the default the user has chosen for messages in the Mail.app preferences. However, any text that the user can add to the the message now defaults to Helvetica 12 pt.

Is there a way to change the default for text size, either in a preference or through the terminal?

Here's an example of what I'm talking about, where the link text is Helvetica 16 and any additional text added defaults to Helvetica 12.

http://www.qwip.org/pictures/EmailLink.jpg


Solution 1:

There are several ways to do that.

The easiest way would be to install a Plugin which formats outgoing E-Mail and give you the option to change specific characteristics to you liking (Font, Size etc.). For that you should look into the following Plugins:

  1. MessageFont

    "WYSIWYG for your outgoing emails If Outlook for Mac, Thunderbird and other email apps can set the default composition font1, why can’t Apple Mail? With MessageFont, you can! MessageFont lets you set Apple Mail’s default composition font for new rich text outgoing messages. [...]"

  2. Universal Mailer

    "Universal Mailer is a Mail.app plugin that solves some issues when sending emails. It removes ATT00001.htm files, it correctly formats messages with attachments and inline images and offers an option to set the default font for outgoing messages. [...]"

Another way would be to change the default Font Size via the Terminal, f.e. in 24, open up the Terminal and type in:

defaults write com.apple.mail MinimumHTMLFontSize 24

That will change the Font to 24pt, but that includes the Page you want to forward from Safari if you choose 'Webpage'. If you just forward the Link everything should be fine.

Solution 2:

If you look at

/Applications/Safari.app/Contents/Resources/Safari.scriptSuite

you will see that Safari calls the AppleEventCode "mlct" which i assume stands for 'Mail Content'. Here is the Section in detail:

    <key>EmailContents</key>
    <dict>
        <key>AppleEventClassCode</key>
        <string>sfri</string>
        <key>AppleEventCode</key>
        <string>mlct</string>
        <key>Arguments</key>
        <dict>
            <key>Target</key>
            <dict>
                <key>AppleEventCode</key>
                <string>dcnm</string>
                <key>Optional</key>
                <string>YES</string>
                <key>Type</key>
                <string>BrowserTabViewItem</string>
            </dict>
        </dict>
        <key>CommandClass</key>
        <string>EmailContents</string>
    </dict>

For testing purposes i have created a signature and changed the Font for viewing E-Mail to Calibri 14pt. After trying to send a Page from Safari i saved and exported the E-Mail-Draft as an .eml-File and opened it in a Text Editor. This is the output which i have indented for better reading purposes:

Content-Type: text/html;
charset=us-ascii
Subject: Apple
Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\))
X-Apple-Base-Url: x-msg://50/
X-Universally-Unique-Identifier: ef77cd79-9fcf-447c-ada5-cec8a3969445
X-Apple-Mail-Remote-Attachments: YES
From: ***
X-Apple-Windows-Friendly: 1
X-Apple-Mail-Signature: 26ED4BEC-3AFB-4807-9E7F-EC7D356D0265
Content-Transfer-Encoding: 7bit
Message-Id: <[email protected]>
X-Uniform-Type-Identifier: com.apple.mail-draft

    <html>
        <head></head>
        <body style="word-wrap: break-word; -webkit-nbsp-mode: space; 
        -webkit-line-break: after-white-space; ">
            <span class="Apple-Mail-URLShareWrapperClass" contenteditable="false">
                <span class="Apple-Mail-URLShareUserContentTopClass" style="font-family: 
                Helvetica !important; font-size: 12px !important; line-height: 14px 
                !important; color: black !important; text-align: left !important; 
                " applecontenteditable="true">Test<br>
            <div id="AppleMailSignature"> 
                <div>
                    <b>Test-Signature</b>
                </div>
            </div> 
            <br>
            </span>
            <span class="Apple-Mail-URLShareSharedContentClass"
                style="position: relative !important; " applecontenteditable="true">
                    <a href="http://www.apple.com/de/">http://www.apple.com/de/</a>
                    <br>
            </span>
            <span class="Apple-Mail-URLShareUserContentBottomClass" 
                style="font-family: Helvetica !important; font-size: 12px !important; 
                line-height: 14px !important; color: black !important; text-align: left !important; " 
                applecontenteditable="true">
                <br>
            </span>
            </span>
        </body>
    </html>

Several things are problematic with this output. It seems like the HTML Code generated by the Apple-Event is creating a CSS-Style with the attribute "!important" within a "span" Element. That means that regardless of your Settings in Apple Mail, 14pt Calibri in my case, it will override this setting and use Helvetica 12px.

The terminal command i mentioned in my first answer seems to be the only Way to adress the default font settings directly and to bypass the Apple Mail Settings.

For any other modfications a detailed analysis of the AppleEvent "mlct" would be necessary, but i don't know where to look for that. Suggestions anyone?