email 추출 방법,이직,전직,퇴직시 기존의 연락처 사전에 확보하기
이직,전직,퇴직시 기존의 연락처 사전에 확보하기
Outlook에서 **내가 받은 모든 이메일의 보낸 사람 주소(From 이메일 주소)**를 추출해서 구글(Gmail) 주소록이나 이메일 발송 시스템에 넣을 수 있는 방법을 알려드릴게요. 다음과 같은 단계로 진행할 수 있습니다.
✅ 1단계: Outlook에서 모든 이메일 주소 추출하기
방법 ①: Outlook 데스크톱 + VBA 매크로 사용
Outlook 설치형(PC용)을 쓰신다면, 다음 매크로를 사용하면 됩니다:
📌 VBA 코드
Dim Mail As MailItem
Dim Inbox As Folder, Sentbox As Folder
Dim Items As Items, SentItems As Items
Dim i As Integer
Dim contactDict As Object
Dim fso As Object, outFile As Object
Dim filePath As String
Dim key As Variant
Dim email As String
Dim displayName As String
' 딕셔너리 생성
Set contactDict = CreateObject("Scripting.Dictionary")
' 받은 편지함 + 보낸 편지함 객체 가져오기
Set Inbox = Application.Session.GetDefaultFolder(olFolderInbox)
Set Sentbox = Application.Session.GetDefaultFolder(olFolderSentMail)
Set Items = Inbox.Items
Set SentItems = Sentbox.Items
' 받은편지함 스캔 (보낸 사람)
For i = 1 To Items.Count
If TypeName(Items(i)) = "MailItem" Then
Set Mail = Items(i)
email = Mail.SenderEmailAddress
displayName = Mail.SenderName
If Not contactDict.exists(email) Then
contactDict.Add email, displayName
End If
End If
Next
' 보낸편지함 스캔 (받는 사람)
For i = 1 To SentItems.Count
If TypeName(SentItems(i)) = "MailItem" Then
Set Mail = SentItems(i)
If Mail.Recipients.Count > 0 Then
Dim r As Recipient
For Each r In Mail.Recipients
email = r.Address
displayName = r.Name
If Not contactDict.exists(email) Then
contactDict.Add email, displayName
End If
Next
End If
End If
Next
' 저장 경로 설정
filePath = Environ("USERPROFILE") & "\Documents\outlook_all_contacts.csv"
' 파일로 쓰기
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile(filePath, True, True)
' 헤더
outFile.WriteLine "Name,Email"
' 데이터 작성
For Each key In contactDict.Keys
outFile.WriteLine """" & contactDict(key) & """,""" & key & """"
Next
outFile.Close
MsgBox "CSV 파일이 저장되었습니다:" & vbCrLf & filePath, vbInformation, "완료"
End Sub
- Outlook 열기 → Alt + F11 → 모듈 삽입 → 위 코드 붙여넣기 → 실행(F5)
방법 ②: Outlook.com 웹에서 수신인 CSV 다운로드
- https://outlook.live.com/ 로그인
- ‘받은 편지함’ → Ctrl + A로 전체 선택 → 오른쪽 클릭 → "다운로드" 또는 "인쇄"
- 메시지 뷰 저장 후, 파싱 도구(예: Excel 또는 Python 스크립트)로 From 주소만 추출
✔ 필요하시면 Python 자동 추출 코드도 드릴 수 있습니다.
✅ 2단계: Gmail 주소록(CSV) 형식에 맞게 정리
구글 연락처용 CSV 필드 예시:
홍길동,hong@example.com
김유진,yujin@example.net
- Excel에 이름, 이메일 열로 정리 → .csv로 저장
✅ 3단계: Gmail에 주소록 등록
- https://contacts.google.com/ 접속
- 왼쪽 메뉴 → “가져오기”
- CSV 파일 업로드
- 자동으로 Gmail 주소록에 등록됨
🔁 추가 옵션: Gmail로 메일 직접 보내기 (대량 발송용)
- 추출한 이메일 리스트를 Google Sheets에 붙여넣고,
Google Apps Script나 YAMM, Mailmeteor 같은 애드온을 써서 메일 병합 발송 가능
📌 보안 주의사항
- 개인 이메일 주소를 제3자 플랫폼으로 무단 전송하거나 공유하면 개인정보 보호법 위반 가능성 있음
- 꼭 본인이 수신한 메일에서 정당한 활용 목적으로만 사용하세요
✅ 요약
| 단계 | 설명 |
| ① Outlook에서 보낸 사람 이메일 주소 추출 | VBA 매크로 또는 Python/Excel 활용 |
| ② Google Contacts에 맞게 CSV로 정리 | Name, Email 형식 |
| ③ Gmail 주소록에 업로드 | contacts.google.com → 가져오기 기능 이용 |
=====
✅ 사용 방법 요약
- Outlook 실행 → Alt + F11 (VBA 편집기)
- 삽입 > 모듈 → 위 코드 전체 붙여넣기
- F5 키로 실행
- 내 문서 경로에 outlook_senders.csv 파일 생성됨
📂 예: C:\Users\홍길동\Documents\outlook_senders.csv
outlook_senders.csv
Sub ExportAllEmailContactsToCSV()
Dim Mail As MailItem
Dim Inbox As Folder, Sentbox As Folder
Dim Items As Items, SentItems As Items
Dim i As Integer
Dim contactDict As Object
Dim fso As Object, outFile As Object
Dim filePath As String
Dim key As Variant
Dim email As String
Dim displayName As String
' 딕셔너리 생성
Set contactDict = CreateObject("Scripting.Dictionary")
' 받은 편지함 + 보낸 편지함 객체 가져오기
Set Inbox = Application.Session.GetDefaultFolder(olFolderInbox)
Set Sentbox = Application.Session.GetDefaultFolder(olFolderSentMail)
Set Items = Inbox.Items
Set SentItems = Sentbox.Items
' 받은편지함 스캔 (보낸 사람)
For i = 1 To Items.Count
If TypeName(Items(i)) = "MailItem" Then
Set Mail = Items(i)
email = Mail.SenderEmailAddress
displayName = Mail.SenderName
If Not contactDict.exists(email) Then
contactDict.Add email, displayName
End If
End If
Next
' 보낸편지함 스캔 (받는 사람)
For i = 1 To SentItems.Count
If TypeName(SentItems(i)) = "MailItem" Then
Set Mail = SentItems(i)
If Mail.Recipients.Count > 0 Then
Dim r As Recipient
For Each r In Mail.Recipients
email = r.Address
displayName = r.Name
If Not contactDict.exists(email) Then
contactDict.Add email, displayName
End If
Next
End If
End If
Next
' 저장 경로 설정
filePath = Environ("USERPROFILE") & "\Documents\outlook_all_contacts.csv"
' 파일로 쓰기
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile(filePath, True, True)
' 헤더
outFile.WriteLine "Name,Email"
' 데이터 작성
For Each key In contactDict.Keys
outFile.WriteLine """" & contactDict(key) & """,""" & key & """"
Next
outFile.Close
MsgBox "CSV 파일이 저장되었습니다:" & vbCrLf & filePath, vbInformation, "완료"
End Sub
===============================
Gmail 주소록(Contacts)을 회사별로 분류하려면, 구글 주소록(Google Contacts)에서 다음 절차를 따르면 됩니다.
✅ 1. 구글 주소록(Google Contacts) 접속
- contacts.google.com 으로 이동
- 로그인 (Gmail 계정)
✅ 2. 회사명(Company) 정보 입력 또는 확인
방법 A. 개별 연락처 편집
- 연락처 클릭
- 연필(✏️) 모양 클릭 → 편집
- “회사” 필드에 회사명 입력
- 저장
💡 회사명이 없는 연락처는 분류가 어렵기 때문에 먼저 회사 필드 입력부터 정리합니다.
✅ 3. 회사명으로 연락처 검색 및 라벨(Label) 생성
- 상단 검색창에 원하는 회사명 입력 (예: Google)
- 검색된 연락처 전체 선택 (체크박스 클릭)
- 상단 툴바 → 라벨 아이콘 🏷️ 클릭
- “새 라벨 만들기” 선택 → Google, 삼성, 네이버 등 회사명 입력
✅ 4. 라벨 기반으로 주소록 정리/분류
- 좌측 메뉴에서 회사별 라벨 클릭 시, 그 회사 소속의 연락처만 필터링됨
- 연락처를 여러 라벨에 중복 포함시킬 수도 있음
🔄 (선택) 주소록 대량 편집하는 법 – Excel로 정리
- 좌측 메뉴 → 내보내기 (Export) → Google CSV
- Excel에서 열기 → 회사명, 이름 등 정리
- 다시 Contacts로 → 가져오기 (Import) → 파일 업로드
💡 이렇게 하면 다수의 연락처를 회사 기준으로 한 번에 정리 가능
📌 팁
- “회사 + 직급”으로 라벨을 세분화할 수도 있습니다 (예: 삼성 | 이사)
- 라벨은 Google Contacts 모바일 앱에서도 그대로 연동됩니다.
======================
✅ 사용 방법 요약( outlook 본문에 있는 email까지 모두 추출하는 모듈)
- Outlook 실행 → Alt + F11 (VBA 편집기)
- 삽입 > 모듈 → 위 코드 전체 붙여넣기
- F5 키로 실행
- 내 문서 경로에 outlook_all_contacts.csv 파일 생성됨
======================
Sub ExportAllEmailContactsToCSV_IncludeBodyEmails()
Dim Mail As MailItem
Dim Inbox As Folder, Sentbox As Folder
Dim Items As Items, SentItems As Items
Dim i As Integer
Dim contactDict As Object
Dim fso As Object, outFile As Object
Dim filePath As String
Dim key As Variant
Dim email As String
Dim displayName As String
' 정규표현식 객체
Dim regex As Object
Dim matches As Object
Dim match As Variant
Set regex = CreateObject("VBScript.RegExp")
With regex
.Global = True
.IgnoreCase = True
.Pattern = "\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b"
End With
' 딕셔너리 생성
Set contactDict = CreateObject("Scripting.Dictionary")
' 받은 편지함 + 보낸 편지함 객체 가져오기
Set Inbox = Application.Session.GetDefaultFolder(olFolderInbox)
Set Sentbox = Application.Session.GetDefaultFolder(olFolderSentMail)
Set Items = Inbox.Items
Set SentItems = Sentbox.Items
' 받은편지함 스캔 (보낸 사람 + 본문)
For i = 1 To Items.Count
If TypeName(Items(i)) = "MailItem" Then
Set Mail = Items(i)
' 보낸 사람
email = Mail.SenderEmailAddress
displayName = Mail.SenderName
If Not contactDict.exists(email) Then
contactDict.Add email, displayName
End If
' 본문에서 이메일 추출
If regex.test(Mail.Body) Then
Set matches = regex.Execute(Mail.Body)
For Each match In matches
email = match.Value
If Not contactDict.exists(email) Then
contactDict.Add email, ""
End If
Next
End If
End If
Next
' 보낸편지함 스캔 (수신자 + 본문)
For i = 1 To SentItems.Count
If TypeName(SentItems(i)) = "MailItem" Then
Set Mail = SentItems(i)
' 수신자
If Mail.Recipients.Count > 0 Then
Dim r As Recipient
For Each r In Mail.Recipients
email = r.Address
displayName = r.Name
If Not contactDict.exists(email) Then
contactDict.Add email, displayName
End If
Next
End If
' 본문에서 이메일 추출
If regex.test(Mail.Body) Then
Set matches = regex.Execute(Mail.Body)
For Each match In matches
email = match.Value
If Not contactDict.exists(email) Then
contactDict.Add email, ""
End If
Next
End If
End If
Next
' 저장 경로 설정
filePath = Environ("USERPROFILE") & "\Documents\outlook_all_contacts.csv"
' 파일로 쓰기
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile(filePath, True, True)
' 헤더
outFile.WriteLine "Name,Email"
' 데이터 작성
For Each key In contactDict.Keys
outFile.WriteLine """" & contactDict(key) & """,""" & key & """"
Next
outFile.Close
MsgBox "CSV 파일이 저장되었습니다:" & vbCrLf & filePath, vbInformation, "완료"
End Sub