Tyler
Tyler

Reputation: 1

Mass mail using AppleScript + CSV...But all emails have increased quote level on iOS

I'm trying to send personalized, individual emails to a list of people on a CSV file using an AppleScript + Apple Mail. Everything's working great, except that the sent messages are displaying with the first quote level on iOS (and in other mail clients).

Photo of indented quote level on iOS

Any ideas how to fix this?

set {lastname, eAddress} to getData()

repeat with i from 1 to count lastname
    tell application "Mail"
        activate
        set mymail to make new outgoing message at the beginning of outgoing messages with properties {subject:"subject"}
        tell mymail
            make new to recipient at beginning of to recipients with properties {address:item i of eAddress}
            delay 0
            set content to "Hi Dr. " & lastname & "," & return & "Email Body"
            
        end tell
        --show message window (otherwise it's hidden)
        set visible of mymail to true
        --bring Mail to front
        activate
        send mymail
    end tell
end repeat


on getData()
    set colA to {}
    set colB to {}
    tell application "Microsoft Excel"
        
        activate
        tell active sheet
            set lastRow to first row index of (get end (last cell of column 1) direction toward the top)
            
            repeat with i from 3 to lastRow
                set end of colA to (value of range ("A" & i))
                set end of colB to (value of range ("B" & i))
            end repeat
        end tell
    end tell
    
    return {colA, colB}
end getData

Upvotes: 0

Views: 203

Answers (0)

Related Questions