C# Toplu Mail Gönderme Programı

C# Toplu Mail Gönderme Programı

9. January 2010

Evet Arkadaşlar sziler için bir yararlı  uygulama daha  hazırladım  bu  uygulamada c#  kullanarak  kullanıcılara toplu  mail gönderme işlemi yapan bir program  hazırladım   örnek programın

bitmiş hali  daha gelişmiş  versiyonu    yazıyorum   tabiki biter bitmez blog  da yayınlanmış  oluçaktır 

i




Source Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net.Mail;
using System.Net;

namespace ExpTopluMailProject
{
    public partial class frmtoplumial : Form
    {
        public frmtoplumial()
        {
            InitializeComponent();
        }

        private void btnyukle_Click(object sender, EventArgs e)
        {
            try
            {
                opfileDialog.ShowDialog();
                if (opfileDialog.FileName != "")
                {
                    lblMail.Items.Clear();
                    StreamReader srRead = new StreamReader(opfileDialog.FileName);

                    while (srRead.EndOfStream == false)
                    {
                        lblMail.Items.Add(srRead.ReadLine().ToString());
                    }
                    srRead.Close();
                }
            }

            catch (Exception ex)
            {

                MessageBox.Show("Hatalı Yükleme !\n\n" + ex.Message);
            }
        }

        private void btngonder_Click(object sender, EventArgs e)
        {


            try
            {
                SmtpClient MailSender = new SmtpClient(txtmailSunucusu.Text);
                MailSender.Credentials = new NetworkCredential(txtmailAdresi.Text, txtsifre.Text);
                MailMessage Mail = new MailMessage();
                Mail.Body = txtIcerik.Text; // Mesajınız
                Mail.IsBodyHtml = true; // Mail Formatı // Eğer Mailiniz Html Kodu içermeyecekse False olsun
                Mail.Subject = txtkonu.Text; // Mailinizin Konusu
                Mail.From = new MailAddress(txtmailAdresi.Text); // Gönderen Adresi
                for (int i = 0; i < lblMail.Items.Count; i++) // Gönderilecek Maillerin Yüklenmesi.
                {
                    Mail.To.Add(lblMail.Items[i].ToString());
                }
                MailSender.Send(Mail); // Mailin Gönderilmesi
                Temizle();

                lblMail.Items.Clear();
                MessageBox.Show("Tüm Mailler Başarı İle Gönderildi");
                txtmailSunucusu.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata Oluştu :\n\n" + ex.Message);
            }

        }
        //Tüm TextBox Temizle
        void Temizle()
        {
            txtmailSunucusu.Text = "";
            txtmailAdresi.Text = "";
            txtsifre.Text = "";
            txtIcerik.Text = "";
            txtkonu.Text = "";
        }
    }
}
 

Projenin  full    ExpTopluMailProject.rar (41,34 kb)

  Kaynak gelecekcoknet

Evet arkadaşlar örnek bir projein sonuna gelmiş olduk tekrar yeni bir projede görüşmek üzere herkeze iyi calışmalar 

Saygılarımla Orhan Türk 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C# , Tüm Projelerim

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading