2 Button
1 CheckBox
2 Listbox (2. sinin Visible ' ini False Yapin)
5 TexTbox

TextBox1 = Mailin kimdem geldiğini gosteriri
TextBox2 = Gonderenin şifresi
TextBox3 = Alıcının e-postası
TextBox4 = Konu Başlığı
TextBox5 = Mesaj

ekleyin

Basit bir e-mail gonderme kodları :

PHP Code:
Dim MyMailMessage As New MailMessage()
MyMailMessage.From = New MailAddress(TextBox1.Text)
MyMailMessage.To.Add(TextBox3.Text)
MyMailMessage.Subject = (TextBox4.Text)
MyMailMessage.Body = TextBox5.Text
Dim SMTPServer As New SmtpClient("smtp.live.com")
SMTPServer.Port = 'smtp port buraya
SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.EnableSsl = True
SMTPServer.Send(MyMailMessage)


Fakat gelişmiş bir e-mail gonderme programı icin boyle bir kod kullanabiliriz : (Button1 - Gonderme Buttonu Kodları : )

PHP Code:
Dim MyMailMessage As New MailMessage()

For Each at In ListBox1.Items ' bu kod ile 1'den fazla resim gonderebiliriz

Dim filez = at




If CheckBox1.Checked Then
MyMailMessage.Attachments.Add(New Attachment(at)) 'checkbox 1 işaretli ise resim gonderebiliriz
End If



PHP Code:
MyMailMessage.From = New MailAddress(TextBox1.Text)
MyMailMessage.To.Add(TextBox3.Text)
MyMailMessage.Subject = (TextBox4.Text)
MyMailMessage.Body = TextBox5.Text

Dim SMTPServer As New SmtpClient('smtp adresi buraya)
SMTPServer.UseDefaultCredentials = False
SMTPServer.Port = 'port eklenecek yer
SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.EnableSsl = True
Dim theCredential As New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.Port = ' Port numarasını buraya ekleyebilirsiniz
SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.EnableSsl = True
SMTPServer.Send(MyMailMessage)
MsgBox("Gonderildi", MsgBoxStyle.Information)



Button2 ( resim ekleme buttonu)

PHP Code:
Dim ofd As New OpenFileDialog
If ofd.ShowDialog = DialogResult.OK Then
Dim FileName As String
FileName = ofd.FileName.Substring(ofd.FileName.LastIndexOf("\ "))
Dim fn As String = FileName.Replace("\", "")
ListBox2.Items.Add(ofd.FileName)
ListBox1.Items.Add(fn)
End If


iyi gunler
__________________