i making app can e-mails in gmail inbox c# console application.
i have code below prints out console email body contents:
usersresource.threadsresource.listrequest threadrequest = service.users.threads.list("me"); ilist<google.apis.gmail.v1.data.thread> threads = threadrequest.execute().threads; foreach(var thread in threads) { //print gmail body content console.writeline("{0}", thread.snippet); }
so how gmail subjects instead? contribution appriciated!
public string getmail(){ gmailservice service = (gmailservice)httpcontext.current.session["service"]; message messagefeed = service.users.messages.list("me").execute().messages.first(); usersresource.messagesresource.getrequest getreq = new usersresource.messagesresource.getrequest(service, "me", messagefeed.id); //"raw": returns full email message data body content in raw field base64url encoded string; payload field not used. getreq.format = usersresource.messagesresource.getrequest.formatenum.raw; message message = getreq.execute(); return message.raw; }
getting more data messages.get in c#
better solution:
Comments
Post a Comment