Reputation: 33
I'm a graphic designer and spend hours every day designing HTML emails for various clients. The code is built in Dreamweaver and the images are stored on a server. To send tests of these campaigns to myself and my clients I've relied on the following process for at least the last eight years:
With Yosemite, this process is broken at step 3. Instead, Mail displays a blank email with no content. I've tried getting around this by moving the HTML file to a server, but Mail is overriding some of the HTML, namely the image dimensions specified in the both the <td>
and <img>
tags.
I've been searching for the past few months for a solution. Anyone else using this same work flow seeing this problem? Or does anyone know of another option for sending HTML emails from Mail?
Using Yosemite 10.10.1, Safari 8.0, Mail 8.1
Upvotes: 2
Views: 8513
Reputation: 42334
I found the only way to successfully do this without breaking responsive layout is to not send through Mail.app but using the open-source Thunderbird.app
Here are my steps:
Upvotes: 0
Reputation: 35
I feel your pain, similar here, had a sweet AppleScript integrated with local Apache server, essentially outward facing DropBox. Users drop files or folders from their local server onto AppleScript, it makes a pretty html with proper links, sends it to Safari, and once rendered it gets created as new HTML email.
Yosemite introduced "markup" tools to Mail attachments, which requires an image kind of file. So what was previously a perfect HTML email, now comes as link to local temp file (useless), or gives an option to convert it to PDF, but links are then all gone, and Mail.app sometimes complains that plug-in is missing.
All in all it feels like an unfinished feature... So Octav is right:
modified AppleScript, if of any use to anyone:
-- create html
set myHTML to "<!DOCTYPE><html><head></head><body>Your HTML here</body></html>"
--Or in DreamWeaver copy source first
set myHTML to the clipboard
-- create a temporary html file
set tempFile to (path to temporary items folder as text) & "temp.html"
do shell script "echo " & myHTML & " > " & quoted form of POSIX path of tempFile
-- open the html file in safari
tell application "Safari"
activate
open file tempFile -- open the html file in safari
set web_page_is_loaded to false
repeat until web_page_is_loaded is true
if (do JavaScript "document.readyState" in document 1) is "complete" then
set web_page_is_loaded to true
else
set web_page_is_loaded to false
delay 1
end if
end repeat
delay 1 --wait a little longer still, otherwise copy will not work
tell application "System Events"
tell process "safari"
keystroke "a" using command down -- Select all
delay 0.3 --wait !important
keystroke "c" using command down -- COPY
delay 0.3 --wait !important
end tell
end tell
end tell
--now, onto Mail schenanigans
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {visible:true, subject:"", content:""}
--this is well dirty, but there doesn't seem to be a better way of selecting message body and giving it a focus
tell application "System Events"
tell process "mail"
keystroke tab --To
delay 0.3
keystroke tab --Cc
delay 0.3
keystroke tab --Subject
delay 0.3
keystroke tab --From
delay 0.3
--add/remove more tabs if you have bcc, priority, etc. fields exposed
keystroke "v" using command down -finally PASTE
end tell
end tell
end tell
Upvotes: 1
Reputation: 11
I ran into the same problem, and discovered a workaround.
Indeed, you can no longer use "Email This Page" to send a local html file to Mail, when opened as a file, using MacOS 10.10 (Yosemite).
However, if you run a local web server (e.g. Apache) and hit the local html file that way (via its address as served up by Apache), then it does work just fine.
Pain, but doable, and worth it for me.
Upvotes: 1
Reputation: 122
After step 1, in Safari hit CMD+A (select all), CMD+C (copy) go to Mail, hit CMD+V (paste)
Upvotes: 1