[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Hey guys I need help with some code. It is making a gmail interface.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 1

File: Matrix.jpg (440KB, 1920x1080px) Image search: [Google]
Matrix.jpg
440KB, 1920x1080px
Hey guys I need help with some code. It is making a gmail interface. It is using C#, I will show you the code I am working with in the comments. I need two more things added to it. I need to be able to check messages and send a message. If someone could help that would be great.
>>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GmailClient
{
class Program
{ string userName;
string password;
static void Main(string[] args)
{
string userName = "";
string password = "";
loggedIn(userName);
userMenu();
}
public static void userMenu()
{
Console.WriteLine("_________Menu__________");
Console.WriteLine("Login");
Console.WriteLine("Check Messages");
Console.WriteLine("Send a Message");
Console.WriteLine("________________________");
}

public static bool loggedIn(string user)
{
if (user.Equals(String.Empty))
{

}
return true;

}
}
}
>>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Net;
using System.Net.Mail;

namespace GmailClient
{
class Gmail
{
public static void sendMail(string userName, string password, string toAddy, string subject, string body)
{


MailAddress fromAddress = new MailAddress(userName);
MailAddress toAddress = new MailAddress(toAddy);

SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(fromAddress.Address, password);

MailMessage message = new MailMessage(fromAddress, toAddress);
message.Subject = subject;
message.Body = body;

smtp.Send(message);

}

public static string[] getMail(string userName, string password)
{
System.Net.WebClient objClient = new System.Net.WebClient();
XmlNodeList nodelist;
XmlNode node;
string response;
XmlDocument xmlDoc = new XmlDocument();

Console.WriteLine("checking for mail...");
objClient.Credentials = new System.Net.NetworkCredential(userName, password);
response = Encoding.UTF8.GetString(objClient.DownloadData("https://mail.google.com/mail/feed/atom/"));
response = response.Replace(@"<feed version=""0.3"" xmlns=""http://purl.org/atom/ns#"">", "<feed>");

xmlDoc.LoadXml(response);
node = xmlDoc.SelectSingleNode("/feed/fullcount");
int mailCount = Convert.ToInt32(node.InnerText);
string[] emails = new string[0];
if (mailCount > 0)
{
emails = new string[mailCount];
nodelist = xmlDoc.SelectNodes("/feed/entry");
node = xmlDoc.SelectSingleNode("title");

int tempCounter = 0;
foreach (XmlNode n in nodelist)
{
emails[tempCounter] = "From: " + n.ChildNodes[6].InnerText + "\nSubject: "+ n.FirstChild.InnerText+"\nSummary: "+n.ChildNodes[1].InnerText;
tempCounter++;
}
}
return emails;
}
}
}
>>
if anyone could help I would really appreciate it.
>>
boomp
>>
another bump.
>>
Another fucking thread? Go on stack overflow or reddit. Why do you think 4chan would help you with your fucking homework??

Please, go into your basement, and hang yourself.
>>
last bump
>>
Fuck
>>
Seriously fuck off. Go anywhere else or learn how to implement SMTP.
Thread posts: 10
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.