Code:
MailMessage oMsg = new MailMessage();
// TODO: Replace with sender e-mail address.
oMsg.From = "[email protected]";
// TODO: Replace with recipient e-mail address.
oMsg.To = "[email protected]";
oMsg.Subject = "Send Using Web Mail";
// SEND IN HTML FORMAT (comment this line to send plain text).
oMsg.BodyFormat = MailFormat.Html;
// HTML Body (remove HTML tags for plain text).
oMsg.Body = "<HTML><BODY><B>Hello World!</B></BODY></HTML>";
// ADD AN ATTACHMENT.
// TODO: Replace with path to attachment.
//String sFile = @"C:\temp\Hello.txt";
//MailAttachment oAttch = new MailAttachment(sFile, MailEncoding.Base64);
//oMsg.Attachments.Add(oAttch);
// TODO: Replace with the name of your remote SMTP server.
SmtpMail.SmtpServer = "server...";//stavim pod komentar da bi slao default ali NEĆE ??????
SmtpMail.Send(oMsg);
MailMessage oMsg = new MailMessage();
// TODO: Replace with sender e-mail address.
oMsg.From = "[email protected]";
// TODO: Replace with recipient e-mail address.
oMsg.To = "[email protected]";
oMsg.Subject = "Send Using Web Mail";
// SEND IN HTML FORMAT (comment this line to send plain text).
oMsg.BodyFormat = MailFormat.Html;
// HTML Body (remove HTML tags for plain text).
oMsg.Body = "<HTML><BODY><B>Hello World!</B></BODY></HTML>";
// ADD AN ATTACHMENT.
// TODO: Replace with path to attachment.
//String sFile = @"C:\temp\Hello.txt";
//MailAttachment oAttch = new MailAttachment(sFile, MailEncoding.Base64);
//oMsg.Attachments.Add(oAttch);
// TODO: Replace with the name of your remote SMTP server.
SmtpMail.SmtpServer = "server...";//stavim pod komentar da bi slao default ali NEĆE ??????
SmtpMail.Send(oMsg);
POMOĆ LJUDI !!!
Još mi to fali da završim seminarski,a za 7 dana ispit...HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Da, kao što rekoh mail šalje samo nakon restartovanja SMTP-a ili kad mu je ćef...nakon 1000-og konektovanja(kako da ga nateram da šalje odmah//nije fora u prioritetu :) )