[UiPath] Gmail 자동화
Gmail로 이메일 수신 및 발신 등에 필요한 Get Secure Credentials 액티비티 (Get Password보다 강력)
1. 윈도우 검색
자격 증명 관리 > Window 자격 증명 > 일반 자격 증명 > 일반 자격 증명 추가
비번은 7번에서의 앱 비밀번호로
2. UiPath
Manage Pacakes > UiPath.credentials 설치
3. UiPath
Get Seure Credentials
속성 > Target 내에 일반 자격 증명내에 주소 입력
Output > Password 변수 만들기 (Type: SecureString)
UserName 변수 만들기 (Type: String)
[참고]
SecureString은 Type Into 액티비트 사용 불가
Type Secure Text 사용 가능
4. UiPath Get IMAP Mail Messages
속성 > Host > Port : 993
Sever : "imap.gmail.com"
5. Gmail > 설정 > 전달 및 POP/IMAP > IMAP엑세스 : IMAP사용
> Pop다운로드 : 모든 메일에 POP사용하기
6. UiPath Get IMAP Mail Messages
속성 > Logon > Email : username (앞서 생성 변수)
> Securepassword : password (앞서 생성 변수)
> Output > Messages : listMailMessage
7. Chrome > 계정 관리 > 보안 > 2단계 인증 > 앱 비밀번호
[참고] 첨부 파일 있는 지 확인하는 조건
mail.Attachments.Any
mail.Attahcments.Count > 0
Move IMAP Mail Message
(메일 옮기는 액티비티)
속성 > Port : 993
> Sever: "imap.gmail.com"
> 메일
> securepassword
Create HTML Content
(HTML 콘텐츠 만드는 액티비티)
Open Editor
HTML 내 변수 설정
Send SMTP Mail Message
(다음, 네이버, 지메일 등 메일 발송)
Port: 587
Sever: "smtp.gmail.com"
Logon >
Secure Password
Options >
IsBodyHTML
데이터 테이블에 컬럼명 추가해서 보내는 방법
Output DataTable
(테이블을 String으로 전환)
Generate Data Table from Text
Formating Options > CSV Parsing : True
Input : strFlower
Output : dtFlower
Autodetect Types: True