Home » » C# – Gmailden – Gmaile ve Hotmaile Mesaj(mail) Atma
15 Ocak 2014 Çarşamba
undefined

C# – Gmailden – Gmaile ve Hotmaile Mesaj(mail) Atma

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net.Mail;
namespace WindowsFormsApplication1
{
 public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 }

 private void btnTemizle_Click(object sender, EventArgs e)
 {
 textBox1.Clear();
 textBox2.Clear();
 textBox3.Clear();
 textBox4.Clear();
 textBox5.Clear();
 }

 private void btnGönder_Click(object sender, EventArgs e)
 {

 try
 {
 if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && textBox5.Text != "")
 {
 MailMessage mail = new MailMessage();
 SmtpClient client = new SmtpClient();
 client.Credentials = new System.Net.NetworkCredential(textBox1.Text, textBox2.Text);
 client.Port = 587;
 client.Host = "smtp.gmail.com";
 client.EnableSsl = true;
 mail.To.Add(textBox4.Text);
 mail.From = new MailAddress(textBox1.Text);
 mail.Subject = textBox5.Text;
 mail.Body = textBox3.Text;
 client.Send(mail);
 MessageBox.Show("Mesaj gönderildi", "Bildirim", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
 else MessageBox.Show("Lütfen Boş alanları dolduralım", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
 }
 catch
 {
 MessageBox.Show("Gmail Adı veya şifre hatalı", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);

 }

 }

 }
}
C# — FileStream ile dosya okuma

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; ...

Fiyatı ve kdv’si girilen ürünün kdvli fiyatını hesaplama C# Console

Fiyatı ve kdv’si girilen ürünün kdvli fiyatını hesaplama C# Console    namespace kdvl...

C# — Xml dosyasının içeriğini datagridview’e aktarmak

Xml dosyasının içeriğini datagridview’e aktarmak C# Aşağıdaki xml dosyasını oluşturup veri.xml ...

C# — Picturebox’ı formun etrafında hareket ettirme

Picturebox’ı formun etrafında dolaştırma C# Aşağıdaki formu oluşturalım.(resim ekleme–> ...

C# — Bilgisayar kapatma programı

Bilgisayar kapatma programı C# using System; using System.Collections.Generic; using System....

C# — Dal Seçimi Programı

Dal Seçimi Programı C# using System; using System.Collections.Generic; using System.Comp...

 
Support : Vaganzi
Copyright © 2013. Visual Studio Kod Bankası - All Rights Reserved
Powered By Vaganzi