User-832373396 posted
<g class="gr_ gr_8 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="8" data-gr-id="8">Hi</g> <g class="gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="5" data-gr-id="5">jrahma</g>,
Emails are not reaching inbox not Spam
Sir, <g class="gr_ gr_70 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="70" data-gr-id="70">i</g> found something working example for you.
using System;
using System.Collections.Generic;
using System.Text;
using EASendMail; //add EASendMail namespace
namespace mysendemail
{
class Program
{
static void Main(string[] args)
{
SmtpMail oMail = new SmtpMail("TryIt");
SmtpClient oSmtp = new SmtpClient();
// Your Hotmail email address
oMail.From = "liveid@hotmail.com";
// Set recipient email address
oMail.To = "support@emailarchitect.net";
// Set email subject
oMail.Subject = "test email from hotmail account";
// Set email body
oMail.TextBody = "this is a test email sent from c# project with hotmail.";
// Hotmail SMTP server address
SmtpServer oServer = new SmtpServer("smtp.live.com");
// Hotmail user authentication should use your
// email address as the user name.
oServer.User = "liveid@hotmail.com";
oServer.Password = "yourpassword";
// Set 587 port, if you want to use 25 port, please change 587 to 25
oServer.Port = 587;
// detect SSL/TLS connection automatically
oServer.ConnectType = SmtpConnectType.ConnectSSLAuto;
try
{
Console.WriteLine("start to send email over SSL...");
oSmtp.SendMail(oServer, oMail);
Console.WriteLine("email was sent successfully!");
}
catch (Exception ep)
{
Console.WriteLine("failed to send email with the following error:");
Console.WriteLine(ep.Message);
}
}
}
}
From https://www.emailarchitect.net/easendmail/kb/csharp.aspx?cat=4
Reference
Please have a check :)
Good Luck!
With regards, Angelia Jolie