A work flow to extract email address from mail

Can anyone help me. I have a bunch of emails that contain text information including an email address. I want a Automator workflow that will extract the email addresses from the emails and then save them as a comma separated text file.

Hi,
Try this workflow:
1) Get Selected Mail Items
2) Run AppleScript
In the "Run AppleScript", paste the following in:
on run {input, parameters}
set the output to {}
repeat with i from 1 to count of the input
set theMessage to item i of the input
set theContent to ""
tell application "Mail"
set theContent to the content of theMessage
end tell
if theContent is not equal to "" then
set output to (output & theContent)
end if
end repeat
return output
end run
3) Run Shell Script
In "Run Shell Script", select "/usr/bin/perl" in the shell popup and "to stdin" in the pass input popup. Then paste the following in:
$input = join("", );
@emails = ($input =~ /\b[A-Z0-9._%-]@[A-Z0-9.-]\.[A-Z]{2,4}\b/ig);
while( @emails > 1 ) {
print shift(@emails) . ", ";
print @emails[0];
4) New TextEdit Document
If you select the mail messages that have the email information in them, then you can run the workflow and hopefully it does the right thing.
Hope it helps!

Similar Messages

  • Extract email addresses from Mail?

    A friend uses Mail on OS X 10.2 (Jaguar). He doesn't use Address Book. Instead, when he starts to type an address in Mail, Mail offers to complete it, often with several choices. His archive contains thousands of email addresses. My question: Is there a way to transfer the email addresses in Mail to Address Book without having to do each one manually?
    Mail comes up with choices of email address so quickly that it is hard to believe it scans the whole archive to find them. Does it have a database of some sort that it refers to? And can this database (if one exists) be read as a plain text file?
    Thanks!

    Hello, L.T.
    I don't know how this got messed up, but to manage the discussions you're subscribed to, log in. On the right side of the page, under "Welcome, L. T. Clarke", click on My Subscriptions. Deselect any discussions you don't want to follow.
    With respect to: "However I did post reference to D-LinkDBT-120 adapter that will pair with my bluetooth cell phone 6103", D-Link says "MAC OS X v.10.4.3 or higher required." ( DBT 120 )I don't know, myself, of a way around that requirement. Good luck, though.
    srb

  • Extract email address from html

    Hi,
    I am trying to extract "email address"  from an html output query. How would I do that?
    I am on CF9.
    example:
    Query col1:
    <html><head></head><body>today they emailed about it from (mailto:[email protected]) ...hello there and here</body></html>

    Argh!  No!
    God I hate it when people knock together a regex like this and go "Look!  Email address validation!"
    Before one starts down this road, one should read the RFC (http://tools.ietf.org/html/rfc5322, summarised here: http://en.wikipedia.org/wiki/Email_address).
    Your own regex fails my spamtrap email address (for example: [email protected]), because you've forgotten that a + is a legitimate character in the local part of an email address.  Along with a bunch of other completely legit characters.
    Reading on through the RFC you will realise than ANYTHING is valid in the local part of an email address, provided it's quoted (double-quote being another character your regex doesn't accept).
    If someone doesn't want to give you their valid email address, they won't.  I can give you [email protected], and that will pass.  If I do want to give you my address, you should make sure your code will actually accept it!
    I can understand wanting to make sure the punter doesn't key their email address in incorrectly, but your method doesn't help here.  It'd pass [email protected], despite the fact that it should be [email protected]  "Close" is not good enough in these cases.
    The only sensible way of doing this is to ask them to type it in twice.  This will assist people who don't just roll their eyes and copy and paste what they typed in the first box into the second box, wondering why you're wasting their time.  So a typo will be transferred, so it's no help.
    If you really want to get a person's email address, deprive them of something until they respond to an email that you end them.  At the email address they specified. Because they actually don't mind you having their email address.  This only works if you're not simply trying to harvest email addresses for your own benefit, and not the benefit of your subscribers.
    Bottom line: email address is a mug's game, and one not often played by people who know the rules.
    Adam

  • Is there a program to extract email addresses from a searchable pdf?

    Is there a program that will extract email addresses from a searchable pdf?
    I scanned a 75 page excel spreadsheet and used OCR to create a searchable pdf. I've verified that the OCR did work, the email address are searchable, but I need a way to extract them from the pdf so that I can add them to an email list database. There is other data in the spreadsheets that is not needed and it is making it impossible to just copy and paste. Does anybody know if there is a program available that works on the mac platform for this. Any help is greatly appreciated. Thanks!
    Nate

    Nate B- wrote:
    Is there a program that will extract email addresses from a searchable pdf?
    I scanned a 75 page excel spreadsheet and used OCR to create a searchable pdf. I've verified that the OCR did work, the email address are searchable, but I need a way to extract them from the pdf so that I can add them to an email list database. There is other data in the spreadsheets that is not needed and it is making it impossible to just copy and paste. Does anybody know if there is a program available that works on the mac platform for this. Any help is greatly appreciated. Thanks!
    Nate
    Nate,
    You might want to repost this in the Unix forum, or one of the scripts forums here:
    AppleScripts: http://discussions.apple.com/forum.jspa?forumID=724
    Unix: http://discussions.apple.com/forum.jspa?forumID=735
    Automator: http://discussions.apple.com/forum.jspa?forumID=1261

  • Extract Email Addresses From A Webpage

    I'm trying to use automator to extract email addresses from a webpage. I'm a member of my local chamber and we can use other chamber email addresses we just have to copy and paste them from the chamber website. There are about 5,000 members so I would spend a good week doing this. I'm trying to get Automator to take care of it for me. So far I've used the action "Get Current Webpage From Safari" then "Get Text from Webpage" then "Filter Paragraphs" and I filter to only paragraphs with the @ sign would go through. Now I'm lost. All I really need is a list of the email addresses them selves and not all the junk like the company they work for and bla bla bla. All this stuff is also on the same line as the email address so it all comes through. Is there any way to filter specific text rather than an entire paragraph?

    in that page the emails are always at the end of the line. that simplifies the problem somewhat. add the following "run shell script" action to your workflow right after the action that filters out paragraphs that contain emails
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    for f in "$@"
    do
    echo "$f"|awk '{print $NF}'
    done</pre>
    pass the input to this action as arguments.
    Message was edited by: V.K.

  • Extracting email address from all mailbox in Exchange 2010

    Dear Team,
    I've requirement where i need to pull all the email addresses from all user mailbox accounts in exchange 2010. I need all email addresses to which we've send emails to/Communicated with and all received email addresses. Is there any script or Power Shell
    command to extract email addresses from all mailboxes in our domain(Send and Receive)
    Appreciate your quick help.
    Thanks,
    Mike Baig

    No it is not very clear but this is what I understood...
    "which we've send emails from our domain" - From address should be always primary smtp address.
    "which we've received emails to our domain" - This can be secondary smtp addresses as well.
    To get all email addresses (including secondary smtp addresses) you can use below...
    get-mailbox -ResultSize unlimited | Select displayname, primarysmtpaddress, @{Name="Email Addresses";Expression={[string]::join(', ', $_.EmailAddresses)}} | Export-Csv emailaddress.csv -NoTypeInformation
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • Extract email addresses from PDF file?

    Hi,
    Does somebody know if there is any -builtin- way to extract email addressed from PDF file in acrobat?
    I tried 'save as' text/excel but this is a laborious task, especially when the pdf is large!
    Thanks

    I've developed a script that does just that. Have a look here:
    http://try67.blogspot.com/2012/02/acrobat-list-all-email-addresses.html

  • Extract email addresses from email header - Sender (From) - Mail

    Hi!
    I would like to extract email addresses from email header from field "Sender (From)" and from email body in Mail at the same time.
    I saw only scripts how to extract from email body.
    I get emails asking for some informations about product and many people don't include their email address in the body, so I have to extract from email header as well.
    I would like to extract email addresses from whole email account, separate alphabeticaly, delete duplicates and save it (separated by comma) in text file.
    This I would use for sending massive email to all customers. 
    I'm on OSX 10.6.8.
    Do you have please somebody script for extracting email addresses in the way:
    1. select mail account
    2. run script
    3. save email addresses to txt file
    Thank you for help and advise!

    Hi Neville!
    Last time I was writing basic programs in Turbopascal in 1996.
    Maybe I'm doing something wrong...
    1. I switched off in Mail "Use Smart Addresses".
    2. I changed the path to my account in both commands:
    Command A.
    i=~/Library/Mail/[email protected]@pop.gmail.com # Input file path
    o=~/Desktop/ # Output file path
    n=`date "+%y%m%d%H%M%S"`-"addresses" # time stamped file name
    grep -rh From: $i | grep -o '[-a-zA-Z0-9.]*@.[^>]*' | awk '!seen[$0]++' > $o$n
    Command B.
    grep -rh From: ~/Library/Mail/[email protected]@pop.gmail.com | grep -o '[-a-zA-Z0-9.]*@.[^>]*' | awk '!seen[$0]++' > ~/Desktop/`date \"+%y%m%d%H%M%S\"`"
    3. I write commands in TERMINAL.
    result of Command A:
    List of couple emails same like before switching of "Use Smart Addresses"
    I answered it already above:
    It can extract to .txt file only email addresses from email header which includes after the name as well email address.
    Example:
    From: Neville Hillyer <[email protected]>
    If there is in header only the name without the email address then it's not extracted (email is visible after secondary click on the name)
    Example:
    From: Neville Hillyer
    I just checked that most of emails I have has in the emailheader only the name without the email address so I miss most of email addresses.
    Result of Command B:
    >
    And nothing going on...
    4. I tried the same in AppleScript editor
    Result of Command A:
    Syntax error. A unknown token can’t go after this identifier.
    I changed the path but I still get syntax errors
    (instead of i=~/Library... i put i= Users/muzaa/Library...)
    Result of Command B:
    Syntax error: A “from” can’t go after this identifier.
    grep -rh From: /Users/radimmuzikant/Library/Mail/[email protected]@pop.gmail.com | grep -o '[-a-zA-Z0-9.]*@.[^>]*' | awk '!seen[$0]++' > ~/Desktop/`date \"+%y%m%d%H%M%S\"`"

  • Export email addresses from Mail?

    Is there any way to export email addresses from Mail into a CSV file? I know I can push it to Address Book then export but that mixes all the exports in with my existing addresses.

    If you know SQL, you could export out of the previous recipients database file inside your user/Library/Application Support/AddressBook folder. It's a sqlite3 database.

  • I need a way to extract email address from an offline folder of 13,500 emails. It is still online also but I do not have the password anymore.

    Anyone know how to extract email adresss from a mac mail folder? Thanks

    SandersonShando wrote:
    I mention the word Samsung and you all flip out, and I'm the one that needs to get a life.
    Hyperbole is not very useful on a tech support forum. No one flipped out.
    Whether or not what happened is ridiculous or should or should not have happened is a question for another time and place. You should definitely submit feedback to Apple about it:
    http://www.apple.com/feedback
    Regardless of why it happened or whether it should have happened, the only way to remove the activation lock is to contact Apple. You should be able to do it over the phone. You may be required to send them the original proof of purchase. Use the Contact Us link at the bottom right of every page.
    Once you get the phone working again, do NOT restore it from you existing back up or you will, most likely, be right back where you started.
    Best of luck.

  • How to extract email address from Outlook friendly name cache

    Hi guys,
    A while ago, somebody wrote a little VBA utility to help us to log CRM events. Whenever a user sends an email to a customer, it logs the fact in our CRM database. This is the programmatic process:
    1. Grab the email address from ActiveInspector.CurrentItem.To
    2. If it's a valid email address, all well and good. Proceed to Step 8.
    3. If not a valid email address (it must be a friendly name, perhaps located in Exchange), look for the address in:
    ActiveInspector.CurrentItem.Recipients.Item(1).AddressEntry.GetExchangeUser.PrimarySmtpAddress
    4. If it's a valid email address, all well and good. Proceed to Step 8.
    5. If not a valid email address (it must be in the user's Contact list), look for the address in:
    ActiveInspector.CurrentItem.Recipients.Item(1).AddressEntry.GetContact.Email1Address
    6. If it's a valid email address, all well and good. Proceed to Step 8.
    7. If not a valid email address, then crash!!!         <<------------------------------------------------- Here's where I'm stuck!
    8. Get the CustomerID from the CRM, based on email address.
    9. Do a bunch of other stuff (for example, send the email, and log the event in the CRM).
    I'm a former Access MVP, and am highly experienced with VBA, but my forte is clearly not Outlook. What I'd like to do is find the email address by looking in the local cache, and make sure I get the actual email address rather than the friendly name.
    I'm not sure if 'local cache' is the right word; I know Outlook stores frequently used email address in some sort of cache, even if the user has not explicitly stored it as a Contact. I just don't know how to find it. Can anyone point me in the right
    direction, maybe with a method name?
    Also, while mucking about with it, I found the following. Would it be useful in this scenario?
    ActiveInspector.CurrentItem.Recipients.Item(1).AddressEntry.GetExchangeDistributionList
    Many thanks,
    Graham R Seach
    Regards, Graham R Seach Sydney, Australia

    Hi Graham,
    This might help you to figure things out a bit.
    The contact cache you are looking for is called the nickname cache, also known as the "autocomplete stream."
    The nickname files (.nk2) used by older versions of Outlook (2007 and below).
    Outlook 2010 and 2013 does not use the NK2 file; it stores the autocomplete cache in the mailbox or data file and caches the addresses in an autocomplete stream at C:\Users\username\AppData\Local\Microsoft\Outlook\RoamCache. The cache is stored in a file
    named Stream_Autocomplete_0_[long GUID].dat.
    For applications that interact with Outlook 2010 or Outlook 2013, the autocomplete stream is stored as a MAPI property and can be modified using the MAPI or the
    PropertyAccessor object of the message. The PropertyAccessor object is exposed in the Outlook 2010 or Outlook 2013 object models.
    Outlook 2010 or Outlook 2013 reads the autocomplete stream from a message in the Associated Contents table of the Inbox of the mail account’s delivery store. This hidden message has a message class and subject of IPM.Configuration.Autocomplete. The autocomplete
    stream is stored on this message in the PR_ROAMING_BINARYSTREAM property (PidTagRoamingBinary Canonical Property).
    References:
    How to import .nk2 files into Outlook 2013
    Some Application which can read the Nickname Cache
    Interacting with the Autocomplete Stream
    Autocomplete Stream
    https://msdn.microsoft.com/en-us/library/office/ff625291.aspx
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • I need to extract email addresses from my "Sent" folder, how can I do this?

    I have found a way to export addresses using the "export" option inside the address book-however, I need to extract the addresses from my Sent folder specifically. Is there a way to copy and paste into an Excel file? Or is there a way to do this through Thunderbird?

    Every contact you've sent a message to is automatically added to the Collected Addresses address book. One approach would be to create a new address book, then copy the desired contacts from Collected Addresses to that book by drag and drop, while holding the Ctrl key. Then, export the new address book to a csv (comma separated) file and open it in Excel.
    It's also possible to scan a folder for contacts and have them added to an address book:
    https://getsatisfaction.com/mozilla_messaging/topics/adding_email_address_from_folder_to_address_book#reply_10378723

  • I want to copy the name with email address from Mail like I could before Mavericks

    Hi There
    I have resisted upgrading to Mavericks for all this time because Mavericks now stops the name of the contact being copied when I copy the email address from the sender. What is now copied is: '[email protected]'
    What I want and what it used to be before Mavericks is: 'Dave Garnish <[email protected]>'
    I know it sounds petty but it has stopped me upgrading for all this time, but now I need 4k monitor support.
    Thanks in advance anyone who may have the answer to this.
    Best
    Dave

    The following Terminal command used to enable the use of the name along with the email address:
    defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool YES
    (Change YES to NO to undo the change.)
    I don't know if it still works.
    You can also affect this feature in the mail message via Mail, Preferences, Use Smart Addresses.  When unchecked the sender's address gets the name and angle bracket thing.
    charlie

  • How do i erase a bad email address from mail?

    Hello,
    I once miss typed an email address in mail and it haunts me everyday. If I type the first three letters of the persons name, which is my habit, the bad address is attached to the mail. The result is that I get a server error when i try to send the mail. Then I have to save it as a draft in order to change the address to the correct one by typing fewer of more letters of the recipients first name. I would save myself allot of frustration if I knew where mail stores address shortcuts.
    Thanks very much

    Start by making a new message. Now type in the start of the mistake. When you see the mistake allow it to be put in the To: line. It should appear as a normal address with the little blue button around it. Now right click on the address and pick the choice *Remove From Previous Recipients List*. This should clear that mistake out. I just tried it and it worked for me.

  • Why Can't I slide email addresses from MAIL to ADDRESS BOOK :-(

    Am I missing something?
    Why can't I slide all the email addresses from an email to a group in my Address Boob. I am shocked that this is not easily possible.
    Am I missing the easy way to do this?

    In addition to the suggestions, [Mails Scripts|http://homepage.mac.com/aamann/Mail_Scripts.html] has an applescript that will collect all the addresses in an email and give you the option to select a subset and save to a group or make a new group.

Maybe you are looking for

  • Other in itunes summary on ipod touch

    What is the OTHER category in the ipod touch summary. I have 4 GB of memory used here and do not know what to delete so I can down load an app?

  • New Catalogue from selected images in other Catalogues

    Hi Guys, I have several Catalogues in Lightroom 2.5. I would like to select several images from each Catalogue and put them into a new Catalogue. The reason – In each Catalogue I have flagged the images that I want to print. I want to create a new Ca

  • Windows 7 Taskbar and PSE12 Organiser

    My Windows 7 taskbar does not pop-up as usual at the bottom of the screen when I have PSE 12 Organiser open full screen.  To access my desktop or other programs, I have to minimise PSE 12 organiser. The taskbar works OK when I have PSE 12 Editor open

  • Name conflict / package weirdness

    Hi all I recently came across something weird that caused me a lot of grey hairs. Although I have worked around the problem, the explanation has got me stymied. I have a package hierarchy that looks something like this: zeeb.utils.db.DataAccessClass

  • How to change Static IP in SAPROUTER

    Dear Experts, We have recently changed our static IP number which was configured in our SAPROUTER. I have changed the same in our SAPROUTETAB file. So, users are able to connect the servers thro' routestring. But, From SAP they have not able to fetch