Sumber Kode

Send Email Through Console

  • anonymous
  • Sep 06' 13
  • C Sharp
  • 933
  • 18
  • United States

Here is a listing to send an email from C # using the console:

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Mail;
using System.Net;
class Program
    static void Main(string[] args)
        MailAddress to = new MailAddress(Console.ReadLine());
        MailAddress from = new MailAddress(Console.ReadLine());
        MailMessage mail = new MailMessage(from, to);
        mail.Subject = Console.ReadLine();
        Console.WriteLine("Isi Email");
        mail.Body = Console.ReadLine();
        SmtpClient smtp = new SmtpClient();
        smtp.Host = "";
        smtp.Port = 587;
        smtp.Credentials = new NetworkCredential(
            "", "password");
        smtp.EnableSsl = true;
        Console.WriteLine("Sending email...");

nice read, keep rock 


  • Tags :
comments powered by Disqus

Kode Terkait

Program mencari kpk n buah bilangan

Membuat program bilangan n prima

Piramida angka

Error 945 SQL Server 2008

Looping Leaning Figures

Remarks Script Browser

Creating Specification Page Number

Enter removing Signs In Field (string)

Deleting Log MSSQL Database

Restore and Backup Database MSSQL Using Query