Introduction
Our clients often need to import their Gmail account emails into their application and send them emails. For example, a newsletter or product updates.
Requirement
We need to use Google API to connect with Gmail and import emais.
This link will download the following DLLs to your PC:
Google.GData.Apps.dll
Google.GData.Client.dll
Google.GData.Contacts.dll
Google.GData.Extensions.dll
Create a new Web Application and add reference to these DLLs to your project.
In the Solution Explorer, right-click on the "References" node then select "Add Reference...". In the "Add Reference" window select the "Browse" tab. Browse to the location where the DLLS were put and select one of them then click "OK". Do the same for the other three.
Source Code
Add the following source code to create a design like I created:
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>Import gmail contacts in to ASP.Net | Neha Sharma</title>
- <style type="text/css">
- .auto-style1 {
- height: 26px;
- }
- </style>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <table align="center" style="height: 104px; width: 301px; background-color: #F0F0F0">
- <tr>
- <td>
- Gmail ID</td>
- <td>
- <asp:TextBox ID="txtgmailusername" runat="server"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td class="auto-style1">
- Password</td>
- <td class="auto-style1">
- <asp:TextBox ID="txtpassword" runat="server" TextMode="Password"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td>
- <asp:Button ID="Button1" runat="server" Text="Get" OnClick="Button1_Click" />
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- You have following contacts in Gmail ID</td>
- </tr>
- <tr>
- <td colspan="2">
- <asp:GridView ID="gridemails" runat="server">
- <EmptyDataTemplate>
- You dont have any contacts yet.
- </EmptyDataTemplate>
- </asp:GridView>
- </td>
- </tr>
- </table>
- </div>
- <div>
- <%--<asp:DropDownList ID="ddlemails" runat="server"></asp:DropDownList>--%>
- </div>
- </form>
- </body>
- </html>

Pravat BeraPosted Oct 11, 2017, 8:08 AM
I cant understand first parameter can u explain becuse i have run this code but there an error Additional information: Execution of authentication request returned unexpected result: 404
Gowtham RajamanickamPosted Apr 11, 2015, 1:40 PM
good one
samba sivaPosted Jul 9, 2014, 4:52 AM
good one.
deep gautamPosted Apr 15, 2013, 5:56 AM
Very help full article Neha. Thanku you very much.
Mahesh AllePosted Mar 5, 2013, 7:56 AM
Grate Work....
Vinoth SwaminathanPosted Feb 23, 2013, 6:09 AM
gd artl.....