private static void SendEmail(string name, string emailto, string emailfrom, string subject, string body, string mailserver, bool html)
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(String.Format("{0}<{1}>", name, emailto));
message.From = new System.Net.Mail.MailAddress(emailfrom);
message.Subject = subject;
message.IsBodyHtml = html;
message.Body = body;
string success = SmtpSend(mailserver, message);
}
private static string SmtpSend(string mailserver, System.Net.Mail.MailMessage message)
{
try
{
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(mailserver);
smtp.Send(message);
return ("true");
}
catch (Exception e)
{
return (e.ToString());
}
}
- Home
- Code
- SQL
- arduino
- C#
- Network Ping a Server / Host using C#
- Converting a Hexadecimal Color to a System.Drawing.Color Object
- Send an Email with System.Net.Mail.MailMessage
- C# Convert a String to a Guid
- C# Get the Next Available Drive Letter
- C# Console Application Progress / Update Flower
- C# Send an Email via Gmail
- Run Program as Another User
- VBS
- SharePoint
- SharePoint Detecting Edit Page Mode Programmatically
- Deleting a WebPart from Gallery Using Feature
- Attaching / Removing a Receiver using a Feature
- Convert a SharePoint List into a DataTable
- Bulk Add new items to a SharePoint List using ProcessBatchData
- Securing SharePoint Anonymous Access – web.config
- Get Reference to Current Web in ItemDeleted Event Handler
- Approve all Documents in a Library Programmatically
- Sharepoint 2007 Change Maximum Template Size
- VMWare
- Wind
- Contact
- Legal
