Google.GData.Client read email - c#

I'm using Google's .NET Client Library to read email on my gmail account.
But things are not very clear for me.
I'm trying to retrieve Atom feeds with this code.
FeedQuery query = new FeedQuery();
Service service = new Service("mail", "app-MailChecker-1");
service.setUserCredentials(Username, Password);
query.Uri = new Uri("https://mail.google.com/mail/feed/atom");
AtomFeed feed = service.Query(query);
It gives me a simple exception: can't retrieve feed.
My priority is to accomplish this using Google's .NET Client Library
but other options will be helpful as well.
Additional information: this method works for Google Calendar without a problem.

If you read Google's FAQ about the Google Data Protocol you'll see that it has no data API for GMail.
http://code.google.com/intl/nl-NL/apis/gdata/faq.html#GmailAtomFeed
To quote:
Does Gmail have a Data API?
No, but you can use Gmail's Atom feed with AuthSub or OAuth to request
read-only access to a user's unread messages. The scope should be set
to https://mail.google.com/mail/feed/atom/. An example query would be:
GET https://mail.google.com/mail/feed/atom/
If you're interested in managing your mail, Gmail also has IMAP/POP
support.
I experimented with version 1.9.0.0 of the Google Data .NET Client Library myself. Don't see any references to GMail.
Here's one possible approach on how to retrieve the unread messages:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=292
It's similar to what Christian suggested in his comment.

Related

Does Marketo API support sending emails with dynamic body, subject and recipients?

I've looked into Marketo Email code samples and they're all always refer to either an email created and stored, or at the most, stored with tokens linked to some information related to leads. I have found nothing that satisfy a simple requirement like sending a simple email with dynamic content.
My email sender interface looks like:
interface IEmailDelivery
{
bool Send(IEnumerable<string> recipients, UserNotification notification);
}
I'm looking to implement the above interface with Marketo API, where UserNotification contains the content of the email (subject, to address, body, isHtml.. etc)
You're probably looking for this process: http://developers.marketo.com/blog/sending-transactional-emails-with-the-marketo-rest-api-part-2-custom-content/ There's currently no direct API to send an email, but this will allow customization of content
Marketo emails are intended to be used as part of a marketing campaign when nurturing customers/prospects. Marketo, unfortunately for your case, is not the best tool for the job. SMTP or a cloud based emal solution such as Azure supports or a 3rd party such as mailchimp would be better suited for your request.
But - if you want to use marketo, you can follow the link that the first responder posted (http://developers.marketo.com/blog/sending-transactional-emails-with-the-marketo-rest-api-part-1/).

How to count emails sent exchange 2010

I need to be able to access message tracking from Exchange 2010. I would prefer to do this with some sort of api but from the research that I've done I can seem to find anything that hints to the possibility to do this through EWS. The end goal is to count the number of emails sent by account and store the numbers into a seperate business application.
Edit: After looking at the EWS wsdl it looks like there is a FindMessageTrackingReport and GetMessageTrackingReport call. These are not found in EWS Managed API. I'm not sure this is what I'm looking for but I won't know until I get the results back from the API. Is there a way that I can still call this with just a normal web service? Any examples?
Something to the effect of this should work. I didn't have the time to import the proper namespaces, so it may not be perfect.
string querystring = "From:username#example.com Kind:email";
ItemView iv = new ItemView(1000);
FindItemsResults<Item> foundItems = _service.FindItems(WellKnownFolderName.SentItems, querystring, iv);
int count = foundItems.count();
I was able to finally find a solution. It wasn't through EWS but rather a combination of C#, Powershell, and Exchange Management Shell. Here is a link to the EWS Message Tracking Report solution

How to send private messages with Facebook API using C#

I use Facebook Connect for login on my website and need to create functionality of sending personal messages to user's Facebook friends.
A solution from this question is not suitable for me because I need to send messages to several friends at the same time (user just selects friends from the list who she/he wants to send a message).
I've found pretty good post about this question for Ruby - How to send private messages with Facebook API. But I can't find a C# package similar to xmpp4r_facebook Ruby gem.
agsXMPP SDK and jabber-net don't support X-FACEBOOK-PLATFORM SASL mechanism (http://forum.ag-software.de/thread/1372-Facebook-Chat and Connect to facebook chat using Jabber.net (C#/Mono) with SASL).
I hope to find some existing solution instead of updating one of these libraries. Or to find some library like xmpp4r_facebook but for .NET platform.
Thanks.
The latest sources of agsXMPP supports the X-FACEBOOK-PLATFORM Sasl mechanism.
1) checkout the latest sources
2) add the following code to the OnSaslStart event
private void XmppCon_OnSaslStart(object sender, SaslEventArgs args)
{
args.Mechanism = Mechanism.GetMechanismName(agsXMPP.protocol.sasl.MechanismType.X_FACEBOOK_PLATFORM);
args.ExtentedData = new FacebookExtendedData {AccessToken = "YOUR TOKEN", ApiKey = "YOUR API KEY"};
}
Facebook does not allow the SDK to send private messages to prevent misuse by spammers

How to delete an email from Outlook using C#?

I can successfully retrieve and read emails from Outlook using the following code. How can I delete an email from Outlook? I have tried several ways but couldn't get it to work.
var svc = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
svc.Credentials = CredentialCache.DefaultNetworkCredentials;
svc.AutodiscoverUrl(emailAddress);
EmailMessage email = EmailMessage.Bind(svc, emailMessage.Id, props);
I'm not sure (ie, may be proven incorrect) that you can delete messages using this API. The MSDN article for Microsoft.Exchange.Data.Transport.Email Namespace says this:
The Microsoft.Exchange.Data.Transport.Email namespace contains types that support creating, reading, writing, and modifying e-mail message.
And further inspection of the members available on the EmailMessage class suggest you can access various properties, but there's no "delete" operation/method available.
Depending on your scenario, you might have better luck using a tool like Outlook Redemption which will allow low-level programmatic access to Outlook and/or Exchange (but may not be appropriate if you need to go via exchange web services).

C# Amazon Product Advertising API

As of August 15, Amazon made it compulsory to sign all requests made to their Product Advertising API. I thought I had got everything working just fine but when the 15th finally came around, my web application stopped working and pretty much ever since I have been trying to find out how to sign the SOAP requests.
Amazon has an outdated sample code for signing requests that doesn't appear to work here
Basically, I need to know how to add a signature to the my requests using the most current C# SOAP API and .NET 3.5.
I hope I have given enough details, if I haven't please feel free to ask me to elaborate.
Thank You
The_Lorax
UPDATE:
I am using MVC and need to know how to add the Signature to the the ItemLookup or AWSECommerceService object. Is there an attribute that contains the signature value? How does it get attached to the request?
On this page, they say that I must include the Signature and TimeStamp parameters but the intellisense does now show any such attributes.
Check out http://flyingpies.wordpress.com/2009/08/01/17/. It has a walkthrough and a sample visual studio solution using C#, SOAP, WCF on .NET 3.5.
This library automatic sign the requests (Install-Package Nager.AmazonProductAdvertising)
https://www.nuget.org/packages/Nager.AmazonProductAdvertising/
Example:
var authentication = new AmazonAuthentication("accesskey", "secretkey");
var client = new AmazonProductAdvertisingClient(authentication, AmazonEndpoint.US);
var result = await client.SearchItemsAsync("canon eos");

Categories

Resources