After a little help from youtube I was able to figure out the code for your own personal email client using the Gmail smtp client. The code below is in C# using Visual Studio 2017. I created a form in windows form or wpf with the appropriate elements (labels, boxes and buttons). The code is executed when clicking on the Send button on the form. Hope this helps someone.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;
namespace Email_App_WinForms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void sendButton_Click(object sender, EventArgs e)
{
try
{
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.EnableSsl = true;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("youremail@gmail.com", "*******");
//capture the email info.
MailMessage msg = new MailMessage(
msg.From = new MailAddress(fromTextBox.Text);
msg.To.Add(toTextBox.Text);
msg.Subject = subjectTextBox.Text;
msg.Body = msgTextBox.Text;
client.Send(msg);
MessageBox.Show("Message has been sent");
Close();
}
catch (Exception ex)
{
MessageBox.Show("Unable to send message because of: " + ex.Message);
}
}
This is dedicated to things I have discovered, hobbies that I am involved in, and etc. All Birt related items are now at https://birtreportshelp.blogspot.com/
Tuesday, April 16, 2019
Sony WIC300 Bluetooth Connection to Windows 10
Having purchased a Sony blue tooth headset I found that I was unable to connect my Windows 10 laptop to the headset. After doing much searching I found this link on the Sony website about resetting it back to factory settings. Initializing the headset to restore factory settings. This enabled Windows 10 to then connect to the headset. I then made sure that I had connections to my other devices: phone, tablet, etc. after creating the connection to Windows 10.
Instructions from website:
Instructions from website:
Disconnect the micro-USB cable, turn off the headset, then press and hold the
button and the - button simultaneously for more than 7 seconds.

The indicator (blue) flashes 4 times (
), and the settings such as the volume adjustment are reset to the factory settings. This operation resets volume settings, etc., and deletes all pairing information. In this case, delete the pairing information of the headset from the Bluetooth device, and then pair them again.




If the headset does not operate correctly even after initializing, consult your nearest Sony dealer.
Subscribe to:
Posts (Atom)