Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

SMTP Mail

Posted on February 22, 2013October 26, 2015 By David Kittell
MailMessage m = new MailMessage();
SmtpClient sc = new SmtpClient();
m.From = new MailAddress("email@email.com", "Name Of Person");
m.To.Add(new MailAddress("email@email.com", "Name Of Person"));
m.CC.Add(new MailAddress("email@email.com", "Name Of Person"));
m.Subject = "Email Subject";
m.Body = sResultsHTML;
AlternateView av = AlternateView.CreateAlternateViewFromString(sResultsHTML, null, MediaTypeNames.Text.Html);
m.AlternateViews.Add(av);
sc.Port = 25;
sc.Host = "mail.email.com"; // Email server address IP or Hostname
sc.EnableSsl = false;
sc.Send(m);
Originally Posted on February 22, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code CSharp

Post navigation

Previous post
Next post

Related Posts

PowerShell / Chocolatey Install WAMP

Posted on October 20, 2015October 20, 2015

Following the Chocolatey post we now install WAMP (Windows, Apache, MySQL, and PHP). Open PowerShell as administrator choco install -y wamp-server Configure WAMP for port 8080 copy "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf" "C:\wamp\bin\apache\apache2.4.9\conf\httpd_backup.conf" (gc "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf").replace(‘Listen 0.0.0.0:80′,’Listen 0.0.0.0:8080’) | sc "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf" (gc "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf").replace(‘Listen [::0]:80′,’Listen [::0]:8080’) | sc "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf" (gc "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf").replace(‘ServerName localhost:80′,’ServerName localhost:8080’) | sc "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf"…

Read More

Find Currently Running Query – T-SQL

Posted on April 29, 2013October 26, 2015

SELECT sqltext.TEXT, req.session_id, req.status, req.command, req.cpu_time, req.total_elapsed_time FROM sys.dm_exec_requests req CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext KILL [session_id] Reference: http://blog.sqlauthority.com/2009/01/07/sql-server-find-currently-running-query-t-sql/ Originally Posted on April 29, 2013Last Updated on October 26, 2015 All information on this site is shared with the intention to help. Before any source code or program is ran…

Read More

Last Read / Last Write

Posted on April 29, 2013October 26, 2015

Sometimes you need to know the last time a table or database was read from or written to, this code will help determine that for you. Originally Found At: http://blog.sqlauthority.com/2009/05/09/sql-server-find-last-date-time-updated-for-any-table/ USE <Database_name> SET ANSI_WARNINGS OFF; SET NOCOUNT ON; GO WITH agg AS ( SELECT last_user_seek, last_user_scan, last_user_lookup, last_user_update FROM sys.dm_db_index_usage_stats…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes