public List<Message> GetMessages(
Label folder
)
Public Function GetMessages (
folder As Label
) As List(Of Message)
Dim instance As GmailClient
Dim folder As Label
Dim returnValue As List(Of Message)
returnValue = instance.GetMessages(folder)
public:
List<Message^>^ GetMessages(
Label^ folder
)
member GetMessages :
folder : Label -> List<Message>
No code example is currently available or this language may not be supported.
[Missing <param name="folder"/> documentation for "M:DevCase.ThirdParty.Google.Gmail.GmailClient.GetMessages(Google.Apis.Gmail.v1.Data.Label)"]
No code example is currently available or this language may not be supported.
Dim client As New GmailClient("C:\GoogleSecrets.json", "yourmail@gmail.com", GmailScopes.ReadOnly Or GmailScopes.Modify Or GmailScopes.Send)
Dim credential As UserCredential = client.Authorize()
Dim folder As Google.Apis.Gmail.v1.Data.Label = client.GetFolderByKnownId(GmailFolderIds.Inbox)
Dim messages As List(Of Google.Apis.Gmail.v1.Data.Message) = client.GetMessages(folder)
Dim msgCount As Integer
Dim [date] As String = ""
Dim from As String = ""
Dim subject As String = ""
Dim body As String = ""
For Each msg As Google.Apis.Gmail.v1.Data.Message In messages
For Each header As MessagePartHeader In msg.Payload.Headers
Select Case header.Name
Case "Date"
[date] = header.Value
Case "From"
from = header.Value
Case "Subject"
subject = header.Value
Case Else
' ...
End Select
Next header
Console.WriteLine(String.Format("Count: {0}; Id: {1}; From: {2}, Date: {3}, Subject: {4}",
Interlocked.Increment(msgCount),
msg.Id, from, [date], subject))
body = msg.Payload.Body.Data
' We need to evaluate this because some message bodies are Base64 encoded, and some others aren't.
If DevCase.Core.Cryptography.CryptoUtil.IsBase64Encoded(msg.Payload.Body.Data) Then
body = DevCase.Core.Cryptography.CryptoUtil.Base64Decode(msg.Payload.Body.Data)
End If
' Console.WriteLine(body)
Next msg
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.