Changing "from" in mail using applescript

I am trying to send a notification email from script when it reaches a certain point.
but i would like the from address to read something like "[email protected]" instead of my email address.
here is the code I am using to send the mail
to sendTheMail(mailRecp,mailSubject,mailBody)
tell application "Mail"
set theNewMessage to mail new outgoing message with properties{subject:mailSubject,content:mailBody,visible:false}
tell theNewMessage to recipient at end of recipients with properties{address:mailRecp}
end tell
end tell
end sendTheMail
Where can I put the line to override the from address?
I can't seem to find any information on that.
Thanks,
Pendal

This is quite simple.
FIrst, though, you have to have an account configured in Mail with the email address you want to use - you don't have to enable Checking for that account, but it must exist. Then you can just:
to sendTheMail(mailRecp, mailSubject, mailBody)
  tell application "Mail"
    set theNewMessage to make new outgoing message with properties {subject:mailSubject, content:mailBody, visible:true}
    tell theNewMessage
      make new recipient at end of to recipients with properties {address:mailRecp}
      set sender to "[email protected]"
    end tell
  end tell
end sendTheMail

Similar Messages

  • Cisco EIM 9.0.2- How can I change from e-mail address

    Hello ,
    We are using Cisco EIM/WIM 9.0.2.
    I wnt to manipule my outgouing e-mail address basicly from e-mail address.
    I can not find how can I do that.Can you please give me point for this case.
    How can automatickly change this address on the agent console,
    EX: I want to use [email protected]
    We are using 2 server ,(1 server Web server,1 server app and db server)
    Also we are using standalone integration
    Thanks and Regards,

    Yav,
    Go to the Administration Console in EIM, then Departments. Inside the Department, there will be an Email folder, and inside that is Aliases. In the properties for each Alias, there is an "Email address" field.
    -Jameson

  • Capture Changes from Sql Server  using Oracle Streams  - Destination Oracle

    Is it possible to capture changes made to tables in Sql Server database and propagate the changes to Oracle Database using Oracle Streams and Heterogeneous Gateway. I see plenty of information about pushing data from Oracle to Sql server, but I haven't been able to find much information about going the other way. Currently we are using sql server 2005 replication to accomplish this. We are looking into the possibility of replacing it with streams.

    the brief understanding i have is that there is nothing out of the tin that Oracle provides to stream between SQL Server and Oracle. The senario is documented in Oracle docs however and says you need to implement the SQL Server side to grabe changes and submit to Oracle stream queues.
    i'm sure i've seen third parties who sell software to do this.
    If you know otherwise please let me know. Also wasn;t aware one could push from SQL Server to Oracle. Is this something only avail in SQL Server 2005 or does 200 also have it? How are you doing this?
    Cheers

  • Change System Date [Mac] using Applescript or Javascript?

    Hi All,
    Can anyone suggest me how can i change my Mac date using Apple or Java Script.
    Is it possible or not? If possible then please suggest.
    Shonky

    Thanks to all.
    Problem solved now .
    Here is code.
    set oldDate to do shell script "date '+%m:%d:%y'" as string
    do shell script "systemsetup setdate 03:03:10"
    --Do some stuff
    do shell script ("systemsetup setdate " & oldDate)
    Shonky

  • Can't send email from Apple mail using hosted exchange since upgrade to 10.5.8

    I've got a client who just upgraded to 10.8. Since doing so he can recieve email but not send it for a hosted exchange account. He can send and recieve from his personal pop account. It is a wireless connection.  I have tried the following without any success:
    1. Verified all the config info was correct (server password etc) - no change
    2. Deleted and re-added the account - same result
    3. Deleted keychain data and readed the account - no change.
    4. Ran disk utility (why not?) - no change
    5. Removed an internet sharing app called open garden - no change
    6. Installed 10.8.1 - no change
    After trying all of this when we start mail everything looks good and then the outbound server abruptly goes "offline". The exchange host says there are no issues on their end. Internet works too. Email delivers/sends to his iPhone, iPad, and a home iMac that was also upgraded to 10.8.
    Anyone with other ideas? This one has me stumped.
    -Jonathan

    I have the exact same issue, but with a standard IMAP account and SMTP.  My iPhone can send out, using the EXACT same settings, from the exact same WiFi connection...but the 10.8 MacBook cannot send at all.  The only account I can send out on is my iCloud account. 
    I have also tried all the steps above...no luck.
    I have also turned off all network filters and firewalls...no luck.  (And as I said above, my iPhone is on the exact same WiFi connection and using the exact same settings, and it can send fine.)
    Other messages I've found via Google have suggested simply forcing the SMTP server to use Port 25, but that didn't work for me either.

  • How to set stationery in Mail, using AppleScript

    Is there a way to automatically use specific stationery with Mail, from an AppleScript script?
    To the script below I would like to add an instruction which asigns stationery to the mail message, and so far I have not yet found a working way of doing it.
    on run {theSubject, theBody, theAttachment}
              tell application "Mail"
                        set newMessage to make new outgoing message with properties {visible:true, subject:theSubject, content:theBody & return & return}
                        tell content of newMessage
      make new attachment with properties {file name:theAttachment} at after the last paragraph
                        end tell
      activate
              end tell
    end run
    I found an Automator example which requires the installation of an action, but once installed, it does not work. (It must have worked in OSX 10.6, but it does not on Mountain Lion) Here: Automator: Examples
    Any ideas, anyone?
    Thanks, Oliver

    try this:
    tell application "Numbers"
              tell table 1 of sheet 1 of document 1
                        repeat with i from 1 to row count
                                  if value of cell 14 of row i is equal to renew_month then
                                            set address_to to value of cells of row i
                                  end if
                        end repeat
              end tell
    end tell

  • Extracting email addresses in Mail using AppleScript

    I am using the following script to extract "from" email addresses within a specific mailbox in the Mail app:
    tell application "Mail"
              set mlist to selection
              set cur_mbox to mailbox of item 1 of mlist
              repeat with msg in messages of cur_mbox
                        do shell script "echo " & quoted form of (sender of msg as rich text) & ">>~/.list.txt"
              end repeat
    end tell
    do shell script "cat ~/.list.txt |sort|uniq >~/desktop/list.txt; rm ~/.list.txt"
    This is the format of the names and emails that I am getting in the .txt file:
    "Person, Alex" <[email protected]>
    "Person, Bob" <[email protected]>
    "Person, Chris" <[email protected]>
    I would like to ONLY extract the email address, NOT the name of the person attached, so I can copy and paste them into an Excel spreadsheet very easily.  Can anyone offer up an edit to this script so I only get the list of email addresses in the text file?
    And if anyone wants to take it one step further... I am for sure going to have duplicate emails. Anyone have some script to eliminate doubles?
    Thanks in advance!!

    -

  • Mail; Using applescript to create an auto-reply with attachments

    I know nothing about applescript and so have no clue how to do this. I tried googling a script but couldn't find one. I also saw similar posts on this topic, but couldn't find scripts.
    I am looking for a simple applescript to go into the Mail app rules to reply with an email message with an image attachment. does anyone know where I can find that script? again, I know nothing about applescript, so I cant do it myself, so details would be nice.
    thanks!

    ok no one replied. now i am wondering, how can i get automator to maybe add an attachment to a current outgoing message. i saw an option for that in automator, but it only works if you have automator create a new email message which i dont want. im using mailtemplate to reply to email messages and quickeysx too, so what i need is to add an automator script to just add an attachement (or 2) to the current outgoing email message. or maybe there is an apple script to add attachment to the mail message on screen? any help would be great thanks

  • TS4002 Trouble changing from Yahoo mail to iCloud mail

    I use yahoo mail on macbook pro.. As the mail was repeatedly asking me to check my account password, i considered switching to iCloud mail with @me.com address. I set up the icloud mail account and was able to send and recieve mail from the icloud account. I was also able to forward the new inbox mail from yahoo to icloud.
    However , i am unable to transfer my mail (roughly 400) in my Yahoo inbox to icloud inbox.
    I tried selecting all the mails in Yahoo inbox and attempted Moving as well as Copying them to iCloud inbox. Both did not work.
    Only a couple of mails (around 10) got transferred and nothing was happening. No error message is also shown.
    When i tried to restart the mac, the mail does not shut down and after forcequitting it , a message popped up saying that the 390 mails could not be transferred.
    Can any body help me with this....

    You need to be more patient, you are moving your emails over the internet, it takes a while. Do it again and don't interrupt it this time.

  • Exporting from Keynote 08 using applescript or automator

    Hi
    Does anyone have a method for triggering an export from applescript of an open keynote presentation, I have an action that takes a sequence of images (exported slides) sorts and loads into an new presentation and I would like to then export as .ppt
    This allows the sad ppt user to see the slides perfectly formed (and stops them editing and stealing my ideas). However the last step of the export I have to do manually as I cant see any actions in automator or anything in the applescript dictionary.
    Any ideas
    thanks
    Jon

    I have exactly the same question. I have been experimenting with AS. I found some code that almost works, but it won't select the PDF button. The sheet with the buttons is obviously not a radio button group, and I can't work out what it is.
    tell application "Finder"
    set draggeditems to (choose file)
    repeat with thisFile in draggeditems as list
    tell application "Finder" to reveal item thisFile
    set thisFile to thisFile as alias
    tell application "Keynote" to open thisFile
    tell application "System Events"
    tell application process "Keynote"
    set frontmost to true
    if menu item "Hide Inspector" of menu 1 of menu bar item "View" of menu bar 1 exists then
    keystroke "i" using {command down, option down}
    end if
    click menu item "Export…" of menu 1 of menu bar item "File" of menu bar 1
    repeat until sheet 1 of window 1 exists
    end repeat
    tell sheet 1 of window 1
    click button "PDF" of radio group 1
    click checkbox "Include slide numbers"
    click checkbox "Include date"
    click checkbox "Print each stage of builds"
    click button "Next…"
    end tell
    repeat until button "Export" of sheet 1 of window 1 exists
    end repeat
    tell sheet 1 of window 1
    click button "Export"
    end tell
    delay 3
    keystroke "w" using command down
    end tell
    end tell
    end repeat
    end tell

  • Can't change fonts in mail using preferences/select?

    When I click select the font window comes up and shows the font I want to change. So then I choose another font and nothing changes.
    Thanks for your help,
    Cherzart

    You probably have to select the text you want to change first.
    But: the font that is seen by the recipient is determined by their e-mail client, not yours.

  • Cannot send message (from mac mail) using the server iCloud

    My Mac Mail send stopped working during a large number of mail sends yesterday.Could that be an issue? If so, what to do?
    Message further reads - The sender address [email protected] was rejected by the server smtp.mail.me.com.
    I deleted the account and set it up again, but still can't get the mail out. Same messages
    If I go on to iCloud, mail send is working fine.
    Can anyone see anything wrong or suggest what to do?
    I've deleted the user name below for the screenshot.
    Thanks in anticipation.

    TryinMyBestest wrote:
    My Mac Mail send stopped working during a large number of mail sends yesterday.Could that be an issue? If so, what to do?
    Message further reads - The sender address [email protected] was rejected by the server smtp.mail.me.com.
    I deleted the account and set it up again, but still can't get the mail out. Same messages
    If I go on to iCloud, mail send is working fine.
    Can anyone see anything wrong or suggest what to do?
    I've deleted the user name below for the screenshot.
    Thanks in anticipation.
    There is no user name entered in your SMTP (advanced) preferences.

  • Accessing an AppleScript from within Mail

    Online Help in Mail says that you can automate tasks from within Mail using AppleScript (and Automator). It doesn't tell you how. It recommends that to learn more about AppleScript and Automator one should open those applications and browse their help files. Would that help me to learn how to install an AppleScript in Mail so that I can invoke it?
    Thanks.

    Thanks so much for the pointers, but I have already done those things. The Dictionary for Mail shows the nouns and verbs, but gives no other information. The Automator has about 8 automated tasks for Mail, none of which provide any information regarding how to install and invoke an AppleScript from within Mail. I have seen information on the web that led me to believe that I could put a script in ~/Library/Scripts/Applications/Mail and it would show up in a Script menu in Mail, but I tried this and it had no effect. I think it may not have been current. I was very surprised that Mail's Help facility didn't cover how to do it.
    I would appreciate your further assistance.
    Thank you.

  • When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single and 10pt. It just started doing this a month ago. It does not do it when I am on my laptop or using Explorer. Help, I hate explorer.

    When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single space and 10pt.
    It just started doing this a month ago.
    It does not do it when I am on my laptop or using Explorer.
    Help, I hate explorer.

    If this were a project that I was involved in, I would recapture the media at the correct frame rate and rebuild the sequences correctly.
    Moving from production, to post production, to delivery is a series of steps, and the success of any particular step is based on having all the preceding steps done correctly.
    Shortcuts and workarounds tend to create awkward and difficult problems, that often only surface late in the process.
    MtD

  • HT201320 I have two email accounts. However, the iPad automatically uses the account that I only want to use for business. How can I change the account from which mail is sent and received?

    I have two email accounts. However, the iPad automatically uses the account that I only want to use for business. How can I change the account from which mail is sent and received?

    You are most welcome

Maybe you are looking for