C# Toplu Mail Gönderme Programı

C# Toplu Mail Gönderme Programı

9. January 2010

Read this article in your language IT | EN | DE | ES

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 

FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

C# , Tüm Projelerim

Comments

5/7/2010 5:27:55 AM #
I love this web blog
5/9/2010 9:24:57 AM #
thanx c# toplu mail g&#246;nderme programı

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.015625 saniyede yuklendi.