Zde kod:
Kód: Vybrať všetko
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.Net;
using System.Net.Mail;
using System.Threading;
using System.Net.Mime;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
string userName = "muj mail";
string password = "heslo";
string host = "smtp.seznam.cz";
int port = 25;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
MailAddress to = new MailAddress("mail prichozi);
MailAddress from = new MailAddress("mail odchozi");
MailMessage wpfEmailer = new MailMessage(from,to);
SmtpClient client = new SmtpClient(host,port);
client.Credentials = new NetworkCredential(userName, password);
wpfEmailer.Subject = "bla";
wpfEmailer.Body = "asd";
try
{
client.Send(wpfEmailer);
MessageBox.Show("Message send successfully.");
}
catch (Exception ex)
{
MessageBox.Show("Error:" + ex.ToString());
}
}
}
}Zde chyba:
//obrázky patria do prílohy, prečítaj si pravidlá
//autoeditácia príspevku (26 Nov 2010, 23:35)
Problem vyresen, stacilo dopsat
Kód: Vybrať všetko
client.EnableSsl = true;