Tag Archives: Email

Sites to Check if your email has been compromised in a data breach


Have you heard about the data breach? Is data leaked online and public? Are you a member of the website and want to know that you are a part of a leak?

Then these sites will help you to know.

  1. haveibeenpwned.com

hibp

The site allows you to enter an email address to see if it is compromised in a data breach for free of charge. It is developed by Troy Hunt, a Microsoft MVP awardee for developer security, international speaker and the author on Pluralsight.

If your email is not compromised, then you will get such message.

hibp-check

No pwnage

Otherwise, you will see details of the pwnage.

hibp-check-fail.png

Pwnage found!

The site also provides a free notification service through email, if the future data breach occurs and your account is compromised.

hibp-notify.png

If you want to find emails on a particular domain, you need to go through the verification process.

hibp-domain

It also provides an API which allows the list of pwned accounts to be quickly searched via a RESTful service.

2. breachalarm.com

Breach-Alarm.png

The site provides a service that allows you to check if your email has been posted online, and sign up for email notifications about future password hacks that affect you.

Once you enter your email id, it will show you message on the screen saying they will record your IP for records.

Breach-Alarm-check.png

If your email is not found in the leaks then you will get an appropriate message.

Breach-Alarm-check-safe

Otherwise, you will see a generic message with the date of the recent breach.

Breach-Alarm-check-fail

The site provides “Email watchdog” service which falls in 2 categories.

Individuals and Families where they cover the number of email Id(s).

Breach-Alarm-paid

Business where they cover a domain. Companies that subscribe the service are notified when any of their email addresses appear in a data breach.Breach-Alarm-domain.png

They also provide API which enables third parties to check the breach status of email addresses or domain names. It is a paid service.

3. pwnedlist.com

pl-site.png

Before using the service, you need to do sign up.

pl-site-signup.png

Once you verify your email id, your email will be added into the watchlist. You can then monitor up to 3 email Ids at no charge.

pl-site-watchlist.png

There is no way to know whether you have been compromised in the existing data breaches.

Please comment down here if there are any similar services, I’ll review and add them to this post.

I’ll say that data breaches will happen, but you always try to secure from your side. I’ll recommend using strong and unmemorable password for each account. Use password managers like Keepass, Lastpass, 1password etc to keep track of all that information. Wherever possible turn on 2 step authentication. Use services like Abine to mask your email id and use it on the sites you don’t trust.

Sending E-mail Using ASP.NET


Description and steps:

1. I have created “EmailHelper” class which is very self explanatory.

2. Include the namespace “System.Net.Mail”.

using System.Net.Mail;

Please note: We can include “System.Web.Mail” or “System.Net.Mail“. These 2 namespaces contains classes used to send an email to a Simple Mail Transfer Protocol (SMTP) server for delivery.. But since “System.Web.Mail” is deprecated, It is recommended to use “”System.NET.Mail”.

Even if you can use “System.Web.Mail”, it is not a full .NET native implementation of the SMTP protocol. Instead, it uses the pre-existing COM functionality in CDONTS. System.Net.Mail, in contrast, is a fully managed implementation of an SMTP client.

3. In your Web.config file, include following lines.


<system.net>
<mailSettings>
<smtp from="defaultEmail@yourdomain.com" deliveryMethod="SpecifiedPickupDirectory">
<network host="localhost" port="25" userName="UserName" password="Password"/>
<specifiedPickupDirectory pickupDirectoryLocation="c:\Emails\"></specifiedPickupDirectory>
</smtp>
</mailSettings>
</system.net>

4. Create “Emails” folder on your C drive. P.S. You can create folder anywhere on your system, but path of the folder should be same as like in the web.config file.

5. Code snippet to send mail using “EmailHelper” class.


EmailHelper emailHelper = new EmailHelper("test@email.com", "recepient@email.com", null, null, "This email was sent from my asp.net application", string.Format("Email was sent on {0}<br/></b>This is bold text.</b><br/><I>This is italic</i>", DateTime.Now), true, System.Net.Mail.MailPriority.High);
emailHelper.SendMailMessage();

6. If you are running it locally, you need to configure SMTP on your system. If you don’t know how to do it, please refer the related article links at the bottom of this post.

EmailHelper Class Explained:

1. It contains 2 constructors. First one is default and other one is parameterised.

2. If you use the parameterised constructor while creating instance of the class, you can send mail as shows above by very simple way with only 2 lines of code.

3. It also contains a SendMailMessage method with 1 overload. First one with no input parameters and other one is with multiple parameters.

4. If you want to send emails to multiple users (e.g 2 users in TO, 2 users in CC, 3 users in Bcc etc), then SendMailMessage with multiple input parameter method is for you. Pass the list of persons as per your requirement and call the method.

5. It has one extra method called “IsValidEmailAdress”. It validates email ID’s using regular expressions.

Downloads:

Github [Repository Link]

Box.com [Direct Link to Zip file]

Configure SMTP on Windows 7


Pre-requirement:

You need to install IIS manager first. SMTP setting comes under the IIS manager window.

As, it can be installed ONLY on computers that are running the Enterprise, Professional, or Ultimate editions of Windows 7.

Steps to follow:

1. Run “inetmgr” command to open the IIS manager.

2. Double click the “SMTP E-mail” to open the configuration window.

3. You can see 2 options there. First is to deliver email to SMTP server and second is to store e-mail in pickup directory on your local.

4. If you choose first option, enter the values for “SMTP Server”, “Port” and “Authentication Required”. If you tick the “Use localhost” checkbox, “SMTP Server” will automatically set to “localhost”.

5. If you are developing you web application on your local, set the second option which is “store e-mail in pickup directory” on your local. If this option is set, the emails sent through your application will get stored into your hard drive on your system.

This can also be set in your application’s web.config file.

6. Once all set, click on “Apply” to save the settings.

Hope this helps.

Please comment below this post, if you have any issues or doubts on this.