How to Check if Email Host is Available

How to check if email host is available?

Follow the below Steps :

  • Method 1
    <ol><li>Open up a command prompt (CMD.exe)</li><li>Type&nbsp;<code>nslookup</code>&nbsp;and hit enter</li><li>Type&nbsp;<code>set type=MX</code>&nbsp;and hit enter</li><li>Type the domain name and hit enter, for example:&nbsp;<a href="http://google.com/" target="_blank">google.com</a></li><li>The results will be a list of host names that are set up for SMTP</li></ol>
    </li></ul>
    

                     If no answer is received from DNS server, there is a good chance that there is no SMTP Servers set up for that domain.

    • Method 2
      <ul><li>
      	<p>Generally SMTP servers name are&nbsp;<a href="http://smtp.yourdomain.com/" target="_blank">smtp.yourdomain.com</a>&nbsp;or&nbsp;<a href="http://mail.yourdomain.com/" target="_blank">mail.yourdomain.com</a>&nbsp;, Open command prompt and try to run following two commands</p>
      
      	<ol><li><code>&gt;ping&nbsp;<a href="http://smtp.yourdomain.com/" target="_blank">smtp.yourdomain.com</a></code></li><li><code>&gt;ping&nbsp;<a href="http://mail.yourdomain.com/" target="_blank">mail.yourdomain.com</a></code></li></ol>
      	</li></ul>
      </li><li><strong><strong><strong>Method 3</strong></strong></strong>
      <ul><li>
      	<p>Telnet to SMTP&nbsp;server like</p>
      
      	<pre><code>telnet smtp.mydomain.com 25
      

      	<p>Syntax :</p>
      
      	<pre><code>telnet {smtp_domain_name} {port_number}
      

      	<p>And copy and paste the below</p>
      
      	<pre><code>helo your_domain.com
      

      mail from:<test@your_domain.com>
      rcpt to:<to_email@your_domain.com>
      data
      From: test@your_domain.com
      Subject: test mail from command line

      this is test number 1
      sent from linux box
      .

      	<p><strong>Note :</strong>&nbsp;Do not forgot the "." at the end which represents the end of the message</p>
      	</li></ul>
      </li><li><strong><strong><strong>Powershell commands to send Email</strong></strong></strong>
      <ul><li>$From = "YourEmail@<a href="http://gmail.com/" target="_blank">gmail.com</a>"<br>		$To = "<a href="mailto:AnotherEmail@YourDomain.com" target="_blank">AnotherEmail@YourDomain.com</a>"<br>		$Cc = "YourBoss@<a href="http://yourdomain.com/" target="_blank">YourDomain.com</a>"<br>		$Attachment = "C:\temp\Some random file.txt"<br>		$Subject = "Email Subject"<br>		$Body = "Insert body text here"<br>		$SMTPServer = "<a href="http://smtp.gmail.com/" target="_blank">smtp.gmail.com</a>"<br>		$SMTPPort = "587"<br>		Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `<br>		-Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl `<br>		-Credential (Get-Credential) -Attachments $Attachment</li></ul>
      </li></ul>